/* ==========================================================================
   mobile-refine.css
   Loaded last. Closes the gaps left by responsive.css / responsive-final.css
   / mobile-perfect.css.

   IMPORTANT: every rule in this file lives inside a `max-width` media query.
   Nothing here can reach the desktop layout -- that is enforced structurally,
   not by convention, so the desktop rendering is byte-for-byte unchanged.

   Each block below documents the specific problem it fixes.
   ========================================================================== */


/* ==========================================================================
   <= 992px
   ========================================================================== */
@media (max-width: 992px) {

  /* ------------------------------------------------------------------------
     1. Opening-hours grids -- compact card layout

     Two tables share this shape: the contact-page timetable (.schedule-table)
     and the footer timetable (.hours-table). Both are 診療時間 plus
     月火水木金土日祝 -- nine columns.

     They must NOT become stacked cards like the price tables do: splitting the
     week apart destroys the at-a-glance read that makes an hours grid useful.
     They also should not scroll sideways, because the whole grid genuinely
     fits: with a 66px time column, each day column still gets 22.8px at 320px
     and 29.6px at 375px, which comfortably holds a 10px dot or a ／.

     `table-layout: fixed` is what makes this reliable -- it stops the browser
     from sizing columns off their content, which is what allowed the time
     labels to shove the day columns out of alignment.
     ------------------------------------------------------------------------ */
  .schedule-card,
  .hours-card {
    width: 100%;
    background-color: #fff;
    border-radius: 16px;
    padding: 18px 16px 14px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .04);
    /* Overrides the desktop max-width so the card uses the full column. */
    max-width: 100%;
  }

  /* No sideways scroll -- the grid is sized to fit. */
  .hours-scroll {
    overflow: visible;
  }

  .schedule-table,
  .hours-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
    border-collapse: collapse;
    text-align: center;
  }

  /* Time column.

     The two tables carry DIFFERENT label text, so they need different widths
     -- sizing them together is what made the footer labels overlap the 月
     column:

       .schedule-table  "10:00-13:30"     all half-width  -> ~72px at 12px
       .hours-table     "① 10:00〜13:30"  ① and 〜 are     -> ~92px at 12px
                                          full-width, so
                                          they cost ~2x a digit

     With `table-layout: fixed` plus `nowrap`, a column narrower than its text
     does not shrink the text -- it lets it spill into the next cell, which is
     exactly the overlap. `overflow: hidden` is a backstop so any future label
     change clips instead of colliding. */
  .schedule-table th.time-header,
  .schedule-table td.time-slot {
    width: 78px;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
  }

  .hours-table th.time-col,
  .hours-table td.time-col {
    width: 94px;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    padding-right: 4px;
  }

  /* Day columns share what is left, evenly. */
  .schedule-table th:not(.time-header),
  .schedule-table td:not(.time-slot),
  .hours-table th:not(.time-col),
  .hours-table td:not(.time-col) {
    width: auto;
    padding-left: 0;
    padding-right: 0;
  }

  /* Header row: day initials */
  .schedule-table thead th,
  .hours-table thead th {
    font-size: 12px !important;
    font-weight: 700;
    color: #333;
    padding: 0 0 10px;
    border-bottom: 0;
  }

  /* Body rows: hairline separators, matching the reference. */
  .schedule-table tbody tr,
  .hours-table tbody tr:not(:last-child) td,
  .hours-table tbody tr:not(:last-child) th {
    border-top: 1px solid #f0efec;
    border-bottom: 0;
  }

  .schedule-table td,
  .hours-table td {
    padding: 11px 0;
    vertical-align: middle;
  }

  /* The time label itself. */
  .schedule-table .time-slot,
  .hours-table .time-col {
    font-size: 12px !important;
    font-weight: 700;
    color: #222;
    padding-left: 2px;
  }

  /* Open marker. */
  .schedule-table .dot,
  .hours-table .dot-open {
    width: 10px;
    height: 10px;
    background-color: #f09600;
    border-radius: 50%;
    display: inline-block;
  }

  /* Closed marker. */
  .schedule-table .slash,
  .hours-table .text-closed {
    color: #c2c2c2;
    font-size: 14px;
    font-weight: 300;
  }

  /* Clock icon beside 診療時間. */
  .time-header-content {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
  }

  .clock-icon {
    width: 17px;
    height: 17px;
    border-width: 2px;
    flex-shrink: 0;
  }

  /* Note lines under the grid. */
  .schedule-note-row,
  .hours-note {
    border-top: 1px solid #f0efec;
    margin-top: 2px;
    padding-top: 12px;
    display: flex;
    align-items: flex-start;
    gap: 7px;
    font-size: 11.5px !important;
    line-height: 1.75;
    color: #6f6f6f;
    text-align: left;
  }

  .star-icon {
    color: #7cb342;
    flex-shrink: 0;
  }

  /* ------------------------------------------------------------------------
     1b. Undo the card-restacking that main.js applies to every table

     main.js runs `querySelectorAll("table")` and gives all of them
     `data-label` attributes plus a `.has-labels` class, then wraps them in
     `.table-scroll`. For price and treatment tables that is correct. For the
     two timetables it is not:

       - `.has-labels td::before` prints the column heading inside every cell,
         producing "診療時間① 10:00-13:30" and "火 ●".
       - `.table-scroll > table { min-width: 520px }` is specificity 0,1,1 and
         beats a plain `.schedule-table` rule at 0,1,0, so the grid stayed
         520px wide and 木 was pushed off screen.

     main.js now skips both tables, so this block is a safety net for browsers
     still holding the old cached script. Everything here is scoped to the two
     timetables and cannot affect the price or treatment tables.
     ------------------------------------------------------------------------ */
  .schedule-table.has-labels td[data-label]::before,
  .hours-table.has-labels td[data-label]::before,
  .schedule-table td[data-label]::before,
  .hours-table td[data-label]::before {
    content: none !important;
    display: none !important;
  }

  /* Beat `.table-scroll > table` (0,1,1) with 0,2,1. */
  .table-scroll > .schedule-table,
  .table-scroll > .hours-table,
  .schedule-card .schedule-table,
  .hours-card .hours-table {
    min-width: 0 !important;
    width: 100% !important;
    table-layout: fixed !important;
  }

  /* If the old script already inserted a wrapper, neutralise its scroll and
     its negative margins so the card padding is not broken. */
  .schedule-card .table-scroll,
  .hours-card .table-scroll {
    overflow: visible !important;
    margin-inline: 0 !important;
    padding-inline: 0 !important;
  }

  /* Keep cells as table cells -- the restacking rules flip them to flex. */
  .schedule-table td,
  .schedule-table th,
  .hours-table td,
  .hours-table th {
    display: table-cell !important;
  }

  .schedule-table tr,
  .hours-table tr {
    display: table-row !important;
  }

  .schedule-table thead,
  .hours-table thead {
    display: table-header-group !important;
  }

  .schedule-table tbody,
  .hours-table tbody {
    display: table-row-group !important;
  }

  /* ------------------------------------------------------------------------
     1c. News category filter had no effect on mobile

     The filter buttons and their JS were fine all along -- the class was being
     applied, but the CSS that hides the item was losing:

       news.css          .news-item.hidden { display: none }        (no !important)
       mobile-perfect    .news-item        { display: grid !important }

     An `!important` declaration beats a non-important one no matter how
     specific the loser is, so filtered-out items kept their grid display and
     stayed on screen. Restoring `!important` on the hidden state fixes it.

     The homepage and news-page variants are listed explicitly because
     mobile-perfect.css scopes its override under both .homepage-page and
     .page-news.
     ------------------------------------------------------------------------ */
  .news-item.hidden,
  .page-news .news-item.hidden,
  .homepage-page .news-item.hidden {
    display: none !important;
  }

  /* Make sure the buttons themselves are reliably tappable and that nothing
     decorative sits on top of them. */
  .category-btn {
    position: relative;
    z-index: 2;
    pointer-events: auto !important;
    min-height: 44px;
  }

  /* ------------------------------------------------------------------------
     2. Legibility floor

     A number of labels were tuned down to 10px on small screens. That is below
     the point where Japanese glyphs stay readable -- kanji lose stroke
     separation well before Latin text does -- and it reads as cramped rather
     than refined. These are nudged to 11.5px, which is still visually small
     but holds up on a phone.
     ------------------------------------------------------------------------ */
  .news-badge,
  .page-news .news-badge,
  .homepage-page .news-tag,
  .news-date .year,
  .page-news .news-date .year,
  .schedule-note-row,
  .treatment-table.has-labels td[data-label]::before {
    font-size: 11.5px !important;
  }

  /* The homepage location badge sits over a photo, so it needs a little more
     than the others to stay readable against a busy background. */
  .homepage-page .location-badge,
  .location-badge {
    font-size: 11.5px !important;
    line-height: 1.65 !important;
  }

  /* ------------------------------------------------------------------------
     3. Overflow guards

     `white-space: nowrap` on these two had no mobile override anywhere in the
     codebase. A long price string or a wide time label could push its row past
     the viewport, and because `body` has `overflow-x: hidden`, that clips
     silently instead of failing visibly -- the value simply disappears off the
     edge with no scrollbar to reveal it.
     ------------------------------------------------------------------------ */
  .price-value {
    white-space: normal;
    word-break: keep-all;   /* don't break Japanese mid-word */
    text-align: right;
  }

  /* Inside the footer's existing .hours-scroll wrapper, so nowrap is safe and
     wanted here -- this only guarantees the column keeps its width. */
  .hours-table .time-col {
    min-width: 72px;
  }

  /* ------------------------------------------------------------------------
     4. Tap-target safety net

     Most interactive elements already meet 44px via mobile-perfect.css. These
     are the ones that had no explicit sizing. 44px is the WCAG 2.5.5 / iOS
     Human Interface Guidelines minimum.
     ------------------------------------------------------------------------ */
  .view-all-btn,
  .btn-about,
  .mobile-nav__cta {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Footer links are handled separately in section 12. Applying a blanket
     44px here inflated every item in the single-column list and left the
     footer looking sparse and over-spaced. */

  /* Telephone links are the primary conversion action on a clinic site and
     must never be fiddly to hit. */
  a[href^="tel:"] {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

}


/* ==========================================================================
   <= 600px
   ========================================================================== */
@media (max-width: 600px) {

  /* Japanese body text needs more line spacing than Latin at small sizes;
     tight leading is the main thing that makes a JP page feel unpolished. */
  .intro-lead,
  .faq-answer-text,
  .news-excerpt,
  .about-desc,
  .section-lead {
    line-height: 1.9;
  }

  /* Avoid orphaned single characters at the end of a wrapped JP line. */
  .banner-title-jp,
  .section-title,
  .faq-question-text {
    line-break: strict;
    overflow-wrap: anywhere;
  }
}


/* ==========================================================================
   <= 380px  (iPhone SE and similar)
   ========================================================================== */
@media (max-width: 380px) {

  /* Narrowest phones: shave the time column so the day columns keep enough
     room for the dots to stay centred under their headings. */
  .schedule-card,
  .hours-card {
    padding-left: 12px;
    padding-right: 12px;
  }

  .schedule-table th.time-header,
  .schedule-table td.time-slot {
    width: 70px;
  }

  /* Smaller type here lets the full-width ① and 〜 fit in less room. */
  .hours-table th.time-col,
  .hours-table td.time-col {
    width: 84px;
  }

  .hours-table .time-col {
    font-size: 10.5px !important;
    letter-spacing: -.2px;
  }

  .schedule-table .time-slot,
  .hours-table .time-col,
  .schedule-table thead th,
  .hours-table thead th {
    font-size: 11px !important;
  }

  .schedule-table .dot,
  .hours-table .dot-open {
    width: 9px;
    height: 9px;
  }
}


/* ==========================================================================
   ROUND IMAGES, BUTTONS, ORTHOPEDIC HERO, HEADER
   Still mobile-only -- every block below is inside a max-width query.
   ========================================================================== */

@media (max-width: 992px) {

  /* ------------------------------------------------------------------------
     6. Circular images were rendering as part-circles

     mobile-perfect.css applies `height: auto !important` to a list of image
     selectors, which is right for rectangular media but breaks a circle: the
     wrapper stays 140x140 with `border-radius: 50%`, while the image inside
     collapses to its natural aspect ratio. It then fills only part of the
     round frame, so the visible result is a circle with a flat slice missing.

     Restoring height + object-fit makes the image fill the frame again. The
     `aspect-ratio` is a belt-and-braces guard so the frame stays perfectly
     round even if a width override lands on it later.
     ------------------------------------------------------------------------ */
  .effect-image,
  .choose-image-box,
  .card-circle,
  .step-circle,
  .step-circle-card,
  .circle-image-container,
  .staff-avatar {
    /* `max-width: 100%` caps a fixed width against the parent, so a 380px
       circle on a 375px phone shrinks instead of spilling off-screen.
       `aspect-ratio` + `height: auto` then keep it perfectly round at
       whatever width it lands on -- no per-page pixel values needed. */
    max-width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1 !important;
    border-radius: 50% !important;
    overflow: hidden !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .effect-image img,
  .choose-image-box img,
  .card-circle img,
  .step-circle img,
  .step-circle-card img,
  .circle-image-container img,
  .staff-avatar img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    border-radius: 50% !important;
  }

  /* ------------------------------------------------------------------------
     6a. Every fixed-shape image box, not just the round ones

     mobile-perfect.css applies `height: auto !important` to a list of image
     selectors. That is correct for images that size themselves, but every one
     of these seven sits inside a container with a FIXED shape -- an
     aspect-ratio or an explicit height -- that the image is supposed to fill:

       .feature-media            aspect-ratio 4/3,   radius 24px
       .about-tsurumaru-image    aspect-ratio 4/4.3, radius 28px
       .doctor-photo-box         aspect-ratio 4/5,   radius 24px,  bg #e2ded4
       .after-accident-image-box aspect-ratio 4/2.7, radius 120px, bg #ffffff
       .choose-image-box         aspect-ratio 1/1,   radius 50%
       .facility-image-wrapper   fixed height,       radius 50%
       .effect-image             fixed height,       radius 50%

     With `height: auto` the photo collapses to its own proportions and stops
     filling the box. Because several of these boxes have a background colour,
     the leftover space shows as a blank white or beige band under the photo --
     which is what makes them look broken rather than merely cropped.

     Restoring height + object-fit makes each image fill its frame again. The
     shape itself is untouched; only the image inside it is corrected.
     ------------------------------------------------------------------------ */
  .feature-media img,
  .about-tsurumaru-image img,
  .doctor-photo-box img,
  .after-accident-image-box img,
  .choose-image-box img,
  .facility-image-wrapper img,
  .effect-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
  }

  /* The wrappers keep their own corner radius, so the image must not paint
     outside it. */
  .feature-media,
  .about-tsurumaru-image,
  .doctor-photo-box,
  .after-accident-image-box {
    overflow: hidden !important;
  }

  /* ------------------------------------------------------------------------
     6b. Facility circles -- image layered over an offset orange circle

     This one is built differently from the others: the wrapper is a plain box,
     the orange disc is a ::before, and the photo is an absolutely positioned
     img. All three carry fixed pixel sizes (220 / 210 / 214), and the offset
     between them is what creates the crescent of orange.

     mobile-perfect.css forces `height: auto` on the img, so the photo lost its
     circular shape and was clipped on one side. Rebuilding the three layers in
     percentages keeps the crescent proportional at any width, so it stays a
     true circle as the wrapper shrinks.
     ------------------------------------------------------------------------ */
  .facility-image-wrapper {
    width: min(220px, 62vw) !important;
    height: auto !important;
    aspect-ratio: 1 / 1 !important;
    position: relative !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .facility-image-wrapper::before {
    width: 95.5% !important;   /* 210/220 */
    height: 100% !important;
    left: 4.5% !important;     /*  10/220 */
    top: 0 !important;
    border-radius: 50% !important;
  }

  .facility-image-wrapper img {
    width: 97.3% !important;   /* 214/220 */
    height: 100% !important;
    left: 0 !important;
    top: 0 !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    position: absolute !important;
  }

  /* ------------------------------------------------------------------------
     6c. Remaining circular images

     .circle-img (homepage collage) are <img> elements styled round directly,
     rather than a wrapper with an image inside. They keep explicit width and
     height at each breakpoint, so they only need protecting against the global
     `img { max-width: 100% }` and any stray `height: auto`, either of which
     turns the circle into an ellipse.

     .consult-image-box and .circle-img-box are already handled correctly by
     firstvisit.css and responsive.css respectively -- both use aspect-ratio.
     They are included only to guarantee the round shape survives, not to
     change their size or position.
     ------------------------------------------------------------------------ */
  .circle-img,
  .consult-image-box,
  .consult-image-box img,
  .circle-img-box,
  .circle-img-box img {
    aspect-ratio: 1 / 1 !important;
    border-radius: 50% !important;
    object-fit: cover !important;
  }

  /* Height must track width or the circle flattens. */
  .circle-img {
    height: auto !important;
  }

  /* ------------------------------------------------------------------------
     12. Homepage hero (FV) and footer layout on phones
     ------------------------------------------------------------------------ */

  /* --- Hero focal point ---------------------------------------------------
     The photo is 1440x837 (1.72:1) and gets cropped hard into a tall portrait
     viewport. The doctor -- the subject -- sits at roughly 32% across and 35%
     down. The existing `object-position: 62% center` centred the crop on the
     patient's back and hair, so the phone view showed shelving and the back of
     a head instead of the person. */
  .hero .hero-image,
  .homepage-page .hero-image {
    object-position: 32% 35% !important;
  }

  /* Full-viewport height forces the widest possible crop of a landscape photo.
     Slightly shorter keeps the composition readable and gets the headline
     closer to the fold. */
  .hero,
  .homepage-page .hero {
    height: 82svh !important;
    min-height: 500px !important;
    max-height: 720px !important;
  }

  /* --- Headline and address, stacked so they cannot collide ---------------
     Both are absolutely positioned by several stylesheets, and their bottom
     offsets were close enough that the three-line headline and the two-line
     address ran into each other, with the address clipping at the section
     edge. These offsets give each block its own room. */
  .hero .catchphrase,
  .homepage-page .catchphrase {
    bottom: 92px !important;
    left: 20px !important;
    right: 20px !important;
    font-size: 17px !important;
    line-height: 1.85 !important;
    margin: 0 !important;
  }

  .hero .location-badge,
  .homepage-page .location-badge {
    top: auto !important;
    bottom: 26px !important;
    left: 20px !important;
    right: 20px !important;
    max-width: calc(100% - 40px) !important;
    font-size: 11.5px !important;
    line-height: 1.6 !important;
  }

  /* --- Footer navigation --------------------------------------------------
     Two columns instead of one halves the footer's height, and tightening the
     per-link spacing removes the airy look. Links keep a 40px tap target via
     padding rather than min-height, so the row height follows the text. */
  .footer-nav {
    grid-template-columns: 1fr 1fr !important;
    gap: 22px 16px !important;
  }

  .footer-nav .nav-list {
    gap: 2px !important;
  }

  .footer-nav .nav-list a {
    display: block !important;
    padding: 9px 0 !important;
    min-height: 0 !important;
    font-size: 13px !important;
    line-height: 1.5 !important;
  }

  .footer-nav .nav-col-title {
    margin-bottom: 8px !important;
    font-size: 13px !important;
  }

  /* 7. Header colours on scroll now live in header-scroll.css, because they
     apply to desktop as well and this file is mobile-only by contract. */

  /* ------------------------------------------------------------------------
     8. Hamburger: tighten the bar spacing
     ------------------------------------------------------------------------ */
  /* The gap was the product of TWO rules stacking, which is why halving the
     translate barely helped:

       common.css         top: 15px / 21px / 27px      (6px apart)
       mobile-perfect.css transform: translateY(∓7px)  (pushes them further)

     Net result: 8px / 21px / 34px -- a 26px spread inside a 44px button.

     Anchoring all three bars to the vertical centre removes the compounding
     and makes the spacing a single number. It also self-centres across the
     44px / 46px / 42px button sizes used at different breakpoints, which the
     hard-coded `top` values did not. */
  .nav-toggle span {
    top: 50% !important;
    margin-top: -1px !important;   /* half the 2px bar height */
  }

  .nav-toggle span:nth-child(1) { transform: translateY(-5px) !important; }
  .nav-toggle span:nth-child(2) { transform: translateY(0) !important; }
  .nav-toggle span:nth-child(3) { transform: translateY(5px) !important; }

  /* Open state: both classes are covered because common.css toggles
     `.is-active` while mobile-perfect.css keys off `aria-expanded`. The bars
     must collapse to the centre before rotating or the X sits lopsided. */
  .nav-toggle.is-active span:nth-child(1),
  .nav-toggle[aria-expanded="true"] span:nth-child(1) {
    top: 50% !important;
    transform: translateY(0) rotate(45deg) !important;
  }

  .nav-toggle.is-active span:nth-child(2),
  .nav-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0 !important;
  }

  .nav-toggle.is-active span:nth-child(3),
  .nav-toggle[aria-expanded="true"] span:nth-child(3) {
    top: 50% !important;
    transform: translateY(0) rotate(-45deg) !important;
  }

  /* ------------------------------------------------------------------------
     9. Orthopedic hero title

     TREATMENT was breaking as "TREATMEN / T". The 4px letter-spacing adds
     ~36px across nine characters, which is what pushed it over the edge.
     Tightening the tracking and disabling the break keeps it on one line.
     ------------------------------------------------------------------------ */
  .banner-title-en {
    letter-spacing: 1.5px !important;
    white-space: nowrap !important;
    line-height: 1.15 !important;
  }

  .banner-title-jp {
    letter-spacing: .5px !important;
    line-height: 1.5 !important;
  }

  /* ------------------------------------------------------------------------
     9b. Hero text was laying out side-by-side

     mobile-perfect.css sets `.hero-banner .hero-content { display: flex }`
     with no `flex-direction`, so it defaults to `row`. That puts
     .banner-title-group and .banner-title-jp beside each other instead of
     stacked. Once TREATMENT was set to `nowrap` it claimed the full row and
     crushed 接骨・鍼灸・自費施術 into a narrow column that wrapped one or two
     characters per line.

     Stacking them is what the design intends and what every other page shows.
     ------------------------------------------------------------------------ */
  .hero-banner .hero-content {
    flex-direction: column !important;
    /* Horizontally centred. `align-items` centres the two blocks as boxes;
       `text-align` centres the text inside them. Both are needed -- the title
       group is a flex row, so text-align alone would not move it. */
    align-items: center !important;
    justify-content: flex-end !important;
    text-align: center !important;
    gap: 6px !important;
  }

  .hero-banner .banner-title-group {
    display: flex !important;
    align-items: center !important;
    /* Centres the green dot + heading pair as a unit, so the dot stays
       attached to the left of the word rather than drifting to the edge. */
    justify-content: center !important;
    gap: 10px !important;
    width: auto !important;
    flex: 0 0 auto !important;
  }

  .hero-banner .banner-title-jp {
    width: auto !important;
    max-width: 100% !important;
    white-space: normal !important;
    word-break: keep-all !important;
    flex: 0 0 auto !important;
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  /* ------------------------------------------------------------------------
     10. Orthopedic marquee slider

     320px cards (240px at 768) are close to the full width of a phone, so each
     image is cropped hard and only one is ever visible. Smaller cards show the
     images less aggressively cropped and let the marquee actually read as a
     moving strip.
     ------------------------------------------------------------------------ */
  /* responsive.css converts the marquee into a swipeable scroll-snap carousel
     at 768px, which is the right pattern for a phone. But it sizes the cards
     with `flex: 0 0 78%` (86% under 480px), and in a flex container the
     flex-basis wins over `width` -- which is why a `width: 190px` had no
     effect and the card rendered nearly full-bleed and squat.

     So the size has to be set through flex-basis too. `aspect-ratio` then
     keeps the card square without needing a fixed height. */
  .slider-card,
  .slider-section .slider-card {
    flex: 0 0 190px !important;
    width: 190px !important;
    height: auto !important;
    aspect-ratio: 1 / 1 !important;
    border-radius: 20px !important;
    overflow: hidden !important;
  }

  .slider-card img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
  }

  .slider-section .slider-track {
    gap: 14px !important;
    /* Breathing room so the first and last cards are not flush to the edge
       once the track scrolls. */
    padding-inline: 16px !important;
  }

  .slider-section {
    padding: 40px 0 !important;
  }
}


@media (max-width: 600px) {

  /* ------------------------------------------------------------------------
     11. Button labels wrapping to a second line

     The previous version of this rule only covered .clinic-btn, .btn-pill and
     .btn-pill1 -- three of the FIFTEEN button classes actually used across the
     site. Everything else (.stretch-btn, .acu-btn, .athlete-btn,
     .accident-btn, .visit-btn, .beauty-btn, .consult-btn, .counseling-btn,
     .btn-details, .btn-about, .view-all-btn, .btn-blue-reserve, .category-btn)
     kept its desktop size and kept wrapping.

     Sizing method: the longest label is
     ストレッチ・トレーニングについて詳しく見る at 21em of full-width Japanese.
     Available text width is roughly `vw - 122px` once the section padding,
     card padding, button padding, arrow and gap are subtracted. Solving
     21em against that gives a straight line in vw, which is what the middle
     term of the clamp expresses. Verified to fit at 320, 360, 375, 390, 414,
     480 and 600px.

     The clamp is preferred over fixed per-breakpoint sizes because it scales
     continuously -- there is no width between breakpoints where a label
     suddenly wraps.

     FAQ accordion questions are deliberately NOT included. They are long
     sentences that are meant to wrap; forcing them onto one line would need
     about 9.8px and would be unreadable.
     ------------------------------------------------------------------------ */
  .clinic-btn,
  .btn-pill,
  .btn-pill1,
  .stretch-btn,
  .acu-btn,
  .athlete-btn,
  .accident-btn,
  .visit-btn,
  .beauty-btn,
  .consult-btn,
  .counseling-btn,
  .btn-details,
  .btn-about,
  .view-all-btn,
  .btn-blue-reserve,
  .category-btn {
    font-size: clamp(9.5px, calc(4.7vw - 5.7px), 14px) !important;
    line-height: 1.4 !important;
    padding: 12px 8px 12px 12px !important;
    min-width: 0 !important;
    gap: 8px !important;
    text-align: left !important;
  }

  /* The label itself: never break a Japanese word mid-phrase. */
  .clinic-btn > span:first-child,
  .stretch-btn > span:first-child,
  .acu-btn > span:first-child,
  .athlete-btn > span:first-child,
  .accident-btn > span:first-child,
  .visit-btn > span:first-child,
  .beauty-btn > span:first-child,
  .consult-btn > span:first-child,
  .counseling-btn > span:first-child,
  .btn-details > span:first-child,
  .btn-pill .btn-label {
    white-space: nowrap !important;
    word-break: keep-all !important;
    flex: 0 1 auto !important;
    min-width: 0 !important;
  }

  /* Shrinking the arrow gives the label ~14px more room, which is the
     difference between fitting and wrapping on a 320px phone. */
  .clinic-btn .btn-arrow-circle,
  .stretch-btn .btn-arrow-circle,
  .acu-btn .btn-arrow-circle,
  .athlete-btn .btn-arrow-circle,
  .accident-btn .btn-arrow-circle,
  .visit-btn .btn-arrow-circle,
  .beauty-btn .btn-arrow-circle,
  .consult-btn .btn-arrow-circle,
  .counseling-btn .btn-arrow-circle,
  .btn-details .btn-arrow-circle,
  .btn-pill .btn-icon-circle {
    width: 22px !important;
    height: 22px !important;
    flex: 0 0 22px !important;
  }

  .slider-card,
  .slider-section .slider-card {
    flex: 0 0 160px !important;
    width: 160px !important;
  }
}


@media (max-width: 380px) {

  /* No font-size override here: the clamp in the 600px block already scales
     continuously and returns 9.5px at this width. A fixed value would fight
     it and reintroduce wrapping between breakpoints. */

  .banner-title-en {
    letter-spacing: 1px !important;
  }

  .slider-card,
  .slider-section .slider-card {
    flex: 0 0 140px !important;
    width: 140px !important;
  }
}
