/* Phone enhancements only. Keep the established tablet/desktop rules intact.
   The second query includes short, touch-operated phones in landscape. */
.chapter-phone-name, .phone-map-toggle, .phone-shared-email, .phone-services-toggle { display:none; }
@media (max-width:600px), (pointer:coarse) and (max-width:1000px) and (max-height:500px) and (orientation:landscape) {
  :root { --phone-gutter:max(16px,env(safe-area-inset-left)); --phone-header:60px; }
  html { scroll-padding-top:calc(var(--phone-header) + 12px); scroll-behavior:auto; }
  html.story-scroll { scroll-snap-type:none; scroll-padding-top:var(--phone-header); }
  .story-page .service-deck, .story-page .service-overview, .story-page .diagnosis-feature,
  .story-page .locations, .story-page .footer { scroll-snap-align:none; scroll-snap-stop:normal; }
  body { font-size:15px; line-height:1.55; }
  .header { height:var(--phone-header); padding-inline:var(--phone-gutter); }
  .header .logo { width:104px; }
  .header .button { min-height:34px; padding:6px 8px; gap:6px; font-size:12px; font-weight:500; background:transparent; color:#e1c475; border:0; border-radius:0; }
  .header .button .icon { width:12px; height:12px; flex-basis:12px; }
  .menu-toggle { min-width:44px; min-height:44px; }
  .mobile-menu { top:var(--phone-header); max-height:calc(100dvh - var(--phone-header)); padding-bottom:max(20px,env(safe-area-inset-bottom)); }
  .mobile-menu a, .mobile-menu summary { min-height:44px; font-size:16px; }
  .button { min-height:40px; padding:8px 12px; font-size:14px; line-height:1.4; }
  .section { padding-inline:var(--phone-gutter); }
  .breadcrumbs { align-items:baseline; }

  .brand-guidance, .chapter-full-name { display:none; }
  .chapter-phone-name { display:inline; }
  .service-deck { padding-inline:0; }
  .deck-enhanced .deck-stage { height:auto; min-height:0; display:block; }
  .deck-controls { padding:0 var(--phone-gutter); min-height:44px; display:flex; background:transparent; backdrop-filter:none; border:0; }
  .chapter-nav { display:flex; justify-content:space-between; align-items:stretch; gap:4px; width:100%; overflow:visible; }
  .chapter-nav a { justify-content:center; text-align:center; white-space:nowrap; min-width:0; min-height:44px; padding:5px 2px; font-size:clamp(10px,2.8vw,12px); font-weight:500; letter-spacing:.01em; text-transform:none; line-height:1.2; border:0; color:#e1ded7; background:none; }
  .chapter-nav a[aria-current='step'] { color:#ead39a; background:none; box-shadow:inset 0 -1px #c2a35d; }
  .chapter-nav a[href='#hyotyajoneuvot'] { display:none; }
  .step-controls, .deck-more { display:none; }
  .deck-enhanced .deck-panels { display:grid; }
  .deck-enhanced .deck-panel { position:relative; grid-area:1 / 1; inset:auto; display:flex; flex-direction:column; justify-content:flex-end; align-self:stretch; min-height:510px; padding-top:235px; }
  .deck-enhanced .deck-panel.is-leaving { visibility:hidden; }
  .deck-visual { position:absolute; order:0; inset:0; width:100%; height:auto; aspect-ratio:auto; }
  .deck-visual img { object-fit:cover; object-position:65% 40%; }
  .deck-visual::after { display:block; background:linear-gradient(180deg,#111b 0%,#11111120 24%,#111111e8 62%,#111 100%); }
  .deck-autoplay { display:flex; top:auto; bottom:12px; right:10px; left:auto; min-width:36px; min-height:36px; padding:8px; border:0; border-radius:0; background:transparent; }
  .deck-autoplay:hover { background:transparent; }
  .deck-related { padding-right:34px; }
  .deck-autoplay [data-playback-label] { display:none; }
  .deck-panel *, .deck-panel.is-entering *, .deck-panel.is-leaving * { animation:none!important; }
  .deck-copy { position:relative; order:0; z-index:3; width:100%; max-width:none; padding:20px var(--phone-gutter) 14px; background:transparent; }
  .deck-copy .eyebrow { font-size:10px; font-weight:500; letter-spacing:.07em; line-height:1.5; margin-bottom:7px; color:#d5bc7c; }
  .deck-copy h1, .deck-copy h2 { max-width:26ch; font-size:22px; font-weight:500; letter-spacing:-.02em; line-height:1.22; }
  .deck-copy h1 br, .deck-copy h2 br { display:none; }
  .deck-description { max-width:43ch; margin-top:9px; font-size:14px; line-height:1.55; color:#d0cdc6; }
  .deck-primary { margin-top:12px; }
  .deck-copy .button { width:auto; max-width:100%; justify-content:center; min-height:38px; padding:8px 11px; font-size:13px; font-weight:500; background:#17171399; color:#e7d29a; border-color:#8a7340; border-radius:2px; }
  .deck-copy .button .icon { width:16px; height:16px; flex-basis:16px; }
  .deck-related { margin-top:6px; gap:0 16px; font-size:12px; }
  .deck-related>span { display:none; }
  .deck-related a { min-height:36px; }
  .quick-contact { display:none; }
  .contact-card { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:4px 0; border:0; border-top:1px solid var(--line); border-radius:0; background:none; }
  .contact-card-heading { min-width:0; }
  .quick-place { display:inline-flex; align-items:center; min-height:44px; font-size:16px; }
  .contact-address, .quick-hours, .contact-card .quick-email, .quick-map { display:none; }
  .contact-links { margin:0; padding:0; }
  .contact-links .quick-phone { font-size:16px; gap:8px; min-height:44px; }

  .story-page .service-overview { display:block; height:auto; min-height:0; padding-block:28px; }
  .story-page .overview-heading { display:none; }
  .overview-heading .eyebrow { font-size:13px; }
  .overview-heading h2 { font-size:24px; line-height:1.15; }
  .overview-heading>p { display:none; }
  .overview-layout { display:block; }
  .service-index { grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px 12px; }
  .service-index article { padding:0; min-width:0; display:flex; flex-direction:column; }
  .service-card-visual { aspect-ratio:4 / 3; border-radius:3px; }
  .service-card-visual::after { inset:10% 0 0; background:linear-gradient(transparent,#0a0a0aeb); }
  .service-photo { width:100%; height:100%; aspect-ratio:auto; margin:0; object-fit:cover; }
  .service-card-visual h3 { left:10px; right:8px; bottom:10px; font-size:15px; line-height:1.2; overflow-wrap:break-word; }
  .service-index p { display:block; font-size:14px; line-height:1.55; margin-top:8px; }
  .service-index .service-link { font-size:13px; line-height:1.4; min-height:36px; margin-top:auto; padding-top:8px; gap:6px; overflow-wrap:anywhere; }
  .service-index .service-link .icon { flex-shrink:0; }
  .diagnosis-feature { margin-top:28px; padding-top:24px; border:0; border-top:1px solid var(--line); background:transparent; overflow:visible; }
  .diagnosis-photo { aspect-ratio:16 / 9; border-radius:6px; }
  .diagnosis-photo img { object-fit:cover; }
  .diagnosis-photo>span { display:none; }
  .diagnosis-content { padding:16px 0 0; }
  .diagnosis-content h3 { font-size:23px; line-height:1.2; }
  .diagnosis-content p, .diagnosis-content li { font-size:16px; line-height:1.6; }
  .diagnosis-content li { padding:10px 0; }
  .diagnosis-content li span { font-size:13px; }
  .diagnosis-content .button { min-height:40px; font-size:14px; }
  .diagnosis-actions { display:grid; gap:8px; justify-items:start; }
  .diagnosis-actions .service-link { min-height:44px; font-size:16px; }
  .section-next { min-height:48px; font-size:15px; line-height:1.4; }

  .story-page .locations { min-height:0; padding-block:28px; justify-content:flex-start; }
  .story-page .locations h2 { font-size:24px; }
  .locations .section-intro { display:block; }
  .locations .section-intro p { font-size:16px; line-height:1.55; margin-top:8px; }
  .location-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; align-items:start; }
  .location-card { padding:12px 10px; border-radius:4px; scroll-margin-top:12px; min-width:0; }
  .location-summary { display:block; }
  .location-heading { gap:4px; }
  .location-heading h3 { font-size:18px; }
  .location-heading h3>a { display:inline-flex; min-height:32px; align-items:center; }
  .location-hours { font-size:12px; gap:5px; }
  .location-hours .icon { width:14px; height:14px; flex-basis:14px; }
  .location-address { font-size:13px; line-height:1.5; margin-top:9px; overflow-wrap:anywhere; }
  .location-contact { margin-top:8px; gap:0; }
  .location-contact .phone { font-size:clamp(13px,3.5vw,15px); min-height:36px; white-space:nowrap; }
  .location-contact .phone .icon { display:none; }
  .location-contact .location-email, .location-call { display:none; }
  .location-card { text-align:center; }
  .location-card .location-heading, .location-card .location-contact { align-items:center; }
  .location-actions { display:grid; justify-content:stretch; gap:4px; margin-top:6px; }
  .location-actions .button { min-height:36px; padding:6px; font-size:13px; gap:5px; }
  .location-actions .button .icon { width:15px; height:15px; flex-basis:15px; }
  .phone-map-toggle { display:inline-flex; align-items:center; justify-content:center; min-height:34px; padding:5px; border:0; border-radius:3px; font:inherit; font-size:12px; color:#dfc57f; background:transparent; }
  .phone-map-toggle:hover { border-color:var(--gold); }
  .phone-map-toggle:focus-visible { outline:2px solid var(--gold); outline-offset:3px; }
  .phone-shared-email { display:inline-flex; align-self:center; margin-inline:auto; align-items:center; gap:8px; min-height:40px; margin-top:10px; font-size:14px; color:#dfc57f; }
  .story-page .locations .location-map { height:150px; margin-block:10px; }
  .location-map[hidden] { display:none; }
  .map-wheel-toggle { display:none; }
  .location-map .leaflet-control-zoom a { min-width:44px; min-height:44px; line-height:44px; }
  .story-page .location-request, .article-page .location-request { display:none; }

  .reading-guide { width:calc(100% - 32px); }
  .reading-guide .button { min-height:40px; padding:8px 12px; font-size:14px; }
  .reader-screen { min-height:0; }
  .reader-title h1 { font-size:28px; line-height:1.16; }
  .reader-image { aspect-ratio:16 / 9; }
  .reader-brief p { font-size:16px; line-height:1.6; }
  .reader-topics { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); overflow:visible; }
  .reader-topics>a { min-height:48px; font-size:15px; white-space:normal; }
  .reader-flow .guide-card, .reading-guide[data-reader-kind=collection] .guide-card { grid-template-columns:72px minmax(0,1fr); gap:12px; }
  .reader-flow .guide-card>img, .reading-guide[data-reader-kind=collection] .guide-card>img { width:72px; height:88px; aspect-ratio:auto; object-fit:cover; }
  .reader-flow .guide-card h3 { font-size:18px; }
  .reader-flow .guide-card p, .reader-reading-area p, .reader-flow .code-fields dd { font-size:16px; line-height:1.6; }
  .reader-search input { font-size:16px; min-height:48px; }
  .footer-main { grid-template-columns:repeat(2,minmax(0,1fr)); gap:24px 16px; }
  .footer-brand { grid-column:1 / -1; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); column-gap:16px; align-items:start; }
  .footer-brand .footer-logo { grid-column:1; grid-row:1; margin-bottom:12px; }
  .footer-brand>p { grid-column:1; grid-row:2; font-size:14px; }
  .footer-brand .footer-email { grid-column:1; grid-row:3; font-size:14px; gap:6px; }
  .footer-brand .footer-contacts { grid-column:2; grid-row:1 / 4; margin:0; font-size:14px; gap:8px; }
  .footer-contacts>div { display:flex; flex-direction:column; align-items:flex-start; gap:0; }
  .footer-contacts a { min-height:36px; white-space:nowrap; }
  .footer-group h2 { font-size:16px; }
  .footer-group>a { font-size:15px; min-height:44px; }
  .footer-bottom { font-size:14px; line-height:1.5; padding-bottom:env(safe-area-inset-bottom); }
  .footer-bottom { grid-template-columns:minmax(0,1fr) auto; gap:14px; }
  .footer-bottom>.footer-legal { grid-column:2; grid-row:1; justify-self:end; gap:12px; font-size:12px; }
  .footer .footer-credit { grid-column:1 / -1; grid-row:2; flex-wrap:wrap; gap:10px; padding-top:20px; }
  .footer-credit>span { width:100%; text-align:center; font-size:13px; }
  .footer-credit img { width:145px; }
}
@media (max-width:360px) {
  .footer-bottom { grid-template-columns:1fr; }
  .footer-bottom>.footer-legal { grid-column:1; grid-row:2; justify-self:start; }
  .footer .footer-credit { grid-row:3; }
  .header { gap:4px; }
  .header .logo { width:96px; }
  .header .button { white-space:nowrap; padding-inline:10px; }
  .header .button .icon { display:none; }
}
/* Short landscape screens need flowing text and room beside the image. */
@media (pointer:coarse) and (min-width:601px) and (max-width:1000px) and (max-height:500px) and (orientation:landscape) {
  html.story-scroll { scroll-snap-type:none; }
  .deck-enhanced .deck-panel { display:flex; min-height:380px; padding-top:165px; }
  .deck-visual { height:auto; min-height:0; }
  .deck-copy { max-width:520px; padding:16px 20px; }
  .deck-autoplay { left:auto; right:10px; }
  .quick-contact, .location-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
  .service-index { grid-template-columns:repeat(4,minmax(0,1fr)); }
  .diagnosis-feature { display:grid; grid-template-columns:40% minmax(0,1fr); gap:20px; align-items:start; }
  .diagnosis-photo { margin-top:16px; }
}
@media (prefers-reduced-motion:reduce) {
  @media (max-width:600px), (pointer:coarse) and (max-width:1000px) and (max-height:500px) and (orientation:landscape) {
    html.story-scroll { scroll-snap-type:none; scroll-behavior:auto; }
    .deck-autoplay:disabled { display:none; }
  }
}
