/* Viewport-based refinements. Desktop rules remain in the existing stylesheets. */
@media (max-width: 1024px) {
  .header-inner { gap: 16px; }
  .menu-toggle { display: block; margin-left: auto; flex: 0 0 44px; width: 44px; height: 44px; }
  .header-cta { display: none; }
  .main-nav { display: none; position: absolute; inset: 100% 20px auto; flex-direction: column; gap: 0; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); max-height: calc(100vh - 110px); max-height: calc(100dvh - 110px); overflow-y: auto; overscroll-behavior: contain; }
  .main-nav.open { display: flex; }
  .main-nav a { min-height: 44px; padding: 10px 8px; overflow-wrap: anywhere; }
  .container :is(.hero-mini,.service-grid,.consult-card,.footer-grid,.bc-nap-card) > * { min-width: 0; }
  .service-grid { grid-template-columns: minmax(0,1fr); }
  .bc-nap-card { grid-template-columns: minmax(0,1fr); }
  .floating-contact { bottom: max(16px,env(safe-area-inset-bottom)); }
}

@media (max-width: 767px) {
  body { font-size: 16px; line-height: 1.75; }
  /* Remove legacy clipping so content widths, rather than a hidden root, fit. */
  html, body { overflow-x: visible; max-width: 100%; }
  body main, body.page-cat-local main { overflow: visible; }
  body .container, body.busan-page .container { width: calc(100% - 36px); max-width: var(--container); padding-inline: 0; }
  main *, .site-footer *, .site-header * { min-width: 0; overflow-wrap: anywhere; }
  :is(img,video,iframe,svg) { max-width: 100%; }
  video, iframe { width: 100%; }
  video { height: auto; }
  .site-header { height: 68px; }
  .header-inner { gap: 10px; }
  .brand { min-width: 0; gap: 9px; }
  .brand-mark { width: 38px; height: 38px; flex: 0 0 38px; }
  .brand-copy strong { font-size: 15px; }
  .brand-copy small { display: none; }
  .main-nav { left: 18px; right: 18px; top: 100%; max-height: calc(100vh - 164px); max-height: calc(100dvh - 164px - env(safe-area-inset-bottom)); }
  .main-nav a { font-size: 15px; }
  .menu-toggle { padding: 0; }
  main :is(h1,h2,h3) { word-break: keep-all; overflow-wrap: anywhere; }
  body main h1, body.page-cat-local .hero-mini-copy h1 { max-width: 100% !important; font-size: clamp(27px,7.5vw,34px) !important; line-height: 1.3 !important; letter-spacing: -.035em !important; }
  body main h2 { font-size: clamp(22px,6.2vw,28px) !important; line-height: 1.4 !important; }
  body main h3 { font-size: clamp(18px,5vw,22px); line-height: 1.45; }
  main :is(p,li):not(.eyebrow):not([class*="kicker"]):not(.card-kicker) { font-size: 15px !important; line-height: 1.8 !important; }
  body.page-cat-local .hero-mini-copy > p:not(.eyebrow), .busan-page .busan-lead, .regions-page .quick-link-card p { display: block !important; overflow: visible !important; -webkit-line-clamp: unset !important; }
  .hero-desc, .hero-trust, .hero-phone-numbers { display: block !important; }
  .hero-desc { margin-block: 16px; }
  .hero-trust { display: grid !important; grid-template-columns: minmax(0,1fr); gap: 12px; }
  body .hero h1 span { display: block !important; font-size: .75em; }
  .hero-grid { grid-template-columns: minmax(0,1fr) !important; grid-template-rows: auto 300px !important; min-height: 0 !important; }
  .hero-copy { grid-row: 1 !important; padding: 28px 0 16px !important; }
  .hero-visual { grid-row: 2 !important; width: 100%; height: 300px !important; }
  body .hero-heart-line { width: min(330px,100%) !important; }
  body .hero-links, body .mini-links, body.page-cat-local .mini-links, .v19-hero-actions, .busan-actions, .cta-actions { display: grid !important; grid-template-columns: minmax(0,1fr) !important; gap: 10px !important; }
  :is(.btn,.cta-phone,.cta-btn,.busan-btn,.bc-nap-actions a,.v20-consult-chip,.v19-country-tabs button,.v19-faq-filter button,.sp-links a,.v19-nearby a,.v20-local-links a) { min-height: 48px; max-width: 100%; padding: 12px 16px; display: inline-flex; align-items: center; justify-content: center; white-space: normal !important; font-size: 15px !important; line-height: 1.5; text-align: center; }
  body.page-cat-local .mini-links .btn { font-size: 15px; min-height: 48px; }
  .bc-nap-actions { gap: 10px; }
  .bc-nap-actions .primary { flex-basis: 100%; }
  body :is(.country-grid,.service-grid,.consult-card,.seo-grid,.sub-grid,.photo-grid,.keyword-hub-grid,.keyword-grid,.related-links-grid,.mini-feature-grid,.quick-link-grid,.region-gallery-grid,.support-image-grid,.media-gallery-grid,.page-preview-grid,.v19-info-grid,.v19-link-row,.v20-trust-grid,.v20-two-col,.v20-check-grid,.v20-country-facts,.sp-flow-grid,.unique-notes-grid,.pair-decision-grid,.busan-country-showcase,.busan-service-duo,.about-country-grid,.about-award-grid,.about-reason-grid,.network-grid,.license-grid,.bc-checklist,.bc-steps) { grid-template-columns: minmax(0,1fr) !important; gap: 16px; }
  body :is(.hero-mini,.deep-editorial-grid,.region-workbook-inner,.pair-decision-title,.sp-editorial-grid,.sp-editorial-grid.reverse,.sp-info-band .container,.v19-hero .container,.v19-split,.v19-consult-layout,.v19-region-story,.v19-sticky-process,.v19-process-card,.about-hero-grid,.about-proof-grid,.about-principles) { grid-template-columns: minmax(0,1fr) !important; gap: 24px; }
  .v19-split.reverse > div:first-child, .sp-editorial-grid.reverse .sp-photo { order: 0; }
  body .hero-mini-copy { order: 0 !important; }
  body .subpage-hero-visual { order: 1 !important; width: 100% !important; min-width: 0 !important; max-width: 100% !important; }
  body :is(.subpage-hero,.v19-hero,.about-hero-grid) { padding-block: 28px !important; min-height: 0; }
  body :is(.section,.sub-intro,.sub-faq,.sub-links,.v19-section,.sp-editorial,.sp-flow,.page-unique-notes,.region-workbook,.about-section,.bc-section,.bc-cluster) { padding-block: 40px !important; }
  body :is(.info-card,.keyword-box,.v20-panel,.v20-local-box,.v19-info-card,.v19-consult-panel,.process-card,.consult-copy,.seo-copy,.seo-links,.keyword-card,.bc-nap-card) { padding: 20px !important; min-height: 0; }
  body .page-preview-frame { max-height: none; transform: none !important; }
  body .page-preview-frame img, body .page-hero-photo { width: 100%; height: auto !important; min-height: 0 !important; max-height: none !important; object-fit: contain !important; aspect-ratio: auto !important; }
  .preview-caption, .sp-photo-note, .v19-caption { font-size: 14px !important; line-height: 1.65; }
  .sp-photo-note, .v19-hero-media .v19-caption { position: relative; inset: auto; max-width: 100%; margin: 0; border-radius: 0; padding: 14px; }
  .v19-hero-media { display: block; min-height: 0; }
  .sp-photo, .sp-photo img { height: auto; min-height: 0 !important; }
  .sp-photo img { aspect-ratio: 4 / 3; object-fit: cover; }
  .country-image { overflow: hidden; }
  body .country-card .country-person { right: 0; max-width: 100%; }
  body .seo-toc ul { grid-template-columns: repeat(2,minmax(0,1fr)) !important; }
  body .seo-toc li:nth-child(n+5) { display: block !important; }
  body .seo-toc a { min-height: 44px; height: 100%; white-space: normal; padding: 10px; font-size: 14px; }
  body.page-cat-local :is(.v19-nearby,.v20-local-links,.sp-links) { flex-wrap: wrap !important; overflow: visible !important; gap: 10px !important; }
  body.page-cat-local :is(.v19-nearby,.v20-local-links,.sp-links) > * { flex: 0 1 auto; white-space: normal !important; }
  .steps { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); overflow: visible; gap: 16px; }
  .steps > div { min-width: 0; }
  .steps > em { display: none; }
  body :is(.v19-step-strip,.v20-timeline,.v19-women-track,.v19-process-nav) { display: grid; grid-template-columns: minmax(0,1fr); overflow: visible; gap: 12px; }
  .v19-step, .v20-time, .v19-woman-card, .v19-process-nav button { min-width: 0; }
  .v19-process-nav { position: static; }
  .v19-process-nav button { min-height: 48px; }
  .v20-timeline::before { display: none; }
  .review-track { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; overflow: visible; padding: 0 18px; }
  .review-track .review-thumb, .review-track .review-thumb img { width: 100%; }
  .review-scroller::before,.review-scroller::after { display: none; }
  .review-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  body .v19-consult-form { grid-template-columns: minmax(0,1fr); }
  .v19-consult-form :is(input:not([type="checkbox"]),select,textarea), #faq-search, #directory-search { min-height: 48px; font-size: 16px; max-width: 100%; }
  body .footer-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px 16px; }
  .footer-grid .footer-brand, body .footer-grid .footer-offices { grid-column: 1 / -1; min-width: 0; }
  body .footer-grid .footer-offices { grid-template-columns: minmax(0,1fr); }
  .site-footer a { overflow-wrap: anywhere; }
  body .footer-bottom .container > * { display: block !important; margin-block: 8px; }
  .footer-bottom a, .footer-nap a { display: inline-flex; align-items: center; min-height: 44px; }
  body .mobile-fixed { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)) !important; left: 16px; right: 16px; bottom: calc(8px + env(safe-area-inset-bottom)); gap: 4px; padding: 4px; }
  body .mobile-fixed a, body .mobile-fixed a:nth-child(n+3) { display: flex !important; min-height: 48px; align-items: center; justify-content: center; padding: 10px 6px; font-size: 14px; line-height: 1.4; white-space: normal; }
  body .mobile-fixed:has(a:nth-child(3)) { grid-template-columns: repeat(3,minmax(0,1fr)) !important; }
  body .site-footer { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  body .floating-contact { display: none !important; }
  main section[id] { scroll-margin-top: 84px; }
  .lb-overlay { padding: calc(72px + env(safe-area-inset-top)) 16px calc(110px + env(safe-area-inset-bottom)); }
  .lb-img { max-width: 100%; max-height: calc(100vh - 200px); max-height: calc(100dvh - 200px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
  .lb-close { width: 48px; height: 48px; top: calc(12px + env(safe-area-inset-top)); }
  .lb-prev, .lb-next { width: 48px; height: 48px; top: auto; bottom: calc(52px + env(safe-area-inset-bottom)); transform: none; }
  .lb-caption { bottom: calc(8px + env(safe-area-inset-bottom)); padding-inline: 64px; max-height: 40px; overflow-y: auto; }
  .hero-heart-line path { animation: none; stroke-dashoffset: 0; }
  .sparkle, .hero-petal { animation: none; }
  .reveal { transition-duration: .2s; transform: none; }
}

@media (max-width: 430px) {
  body .container, body.busan-page .container { width: calc(100% - 32px); }
  body .v20-topic-nav { grid-template-columns: minmax(0,1fr) !important; }
  .busan-mini-process { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
  .busan-mini-process > em { display: none; }
}

@media (max-width: 360px) {
  body .brand-copy strong { font-size: 14px; }
  body :is(.info-card,.v20-panel,.v19-consult-panel,.bc-nap-card) { padding: 16px !important; }
  .hero-links .btn { white-space: normal; }
}

@media (hover: none) and (max-width: 1024px) {
  :is(.country-card,.bc-cluster-grid a,.v20-topic-nav a,.sp-links a,.review-thumb):hover { transform: none; }
  .sp-photo:hover img,.v19-woman-card:hover img { transform: none; }
}

/* Keep comparative data readable without horizontal panning. Labels mirror th text. */
@media (max-width: 767px) {
  .seo-table-scroll, .v19-comparison { overflow: visible; }
  :is(.seo-depth,.v19-comparison) table { display: block; width: 100%; min-width: 0; }
  :is(.seo-depth,.v19-comparison) caption { display: block; padding: 16px; }
  :is(.seo-depth,.v19-comparison) thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  :is(.seo-depth,.v19-comparison) tbody { display: block; }
  :is(.seo-depth,.v19-comparison) tr { display: block; padding: 12px 16px; border-top: 1px solid var(--line); }
  :is(.seo-depth,.v19-comparison) tbody :is(th,td) { display: grid; grid-template-columns: minmax(0,.85fr) minmax(0,1.15fr); gap: 12px; width: 100%; padding: 8px 0; border: 0; font-size: 15px; line-height: 1.65; }
  :is(.seo-depth,.v19-comparison) [data-mobile-label]::before { content: attr(data-mobile-label); font-weight: 700; color: #673b4b; }
  :is(.seo-depth,.v19-comparison) [colspan] { display: block; }
}
@media (min-width: 768px) and (max-width: 1024px) {
  .floating-contact:has(.floating-sms) { width: 182px !important; }
  .about-visual-card { left: 16px; }
}
@media (max-width: 1024px) {
  .busan-service-strip { overflow: visible; }
  body.busan-page .busan-service-strip .container { width: calc(100% - 40px); max-width: 1180px; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
  .busan-service-strip a { min-height: 72px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; }
  .v20-timeline, .v19-process-nav { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); overflow: visible; gap: 12px; }
  .v20-time, .v19-process-nav button { min-width: 0; }
  .regions-page .quick-link-card p { display: block; -webkit-line-clamp: unset; overflow: visible; }
  .review-track { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; padding: 0 20px; overflow: visible; }
  .review-track .review-thumb, .review-track .review-thumb img { width: 100%; }
  .review-scroller::before, .review-scroller::after, .review-hint { display: none; }
}
@media (max-width: 767px) {
  body.busan-page .busan-service-strip .container { width: calc(100% - 32px); padding-inline: 0; grid-template-columns: minmax(0,1fr); }
  .busan-service-strip strong { font-size: 16px; }
  .busan-service-strip small { font-size: 13px; }
  .busan-story-track { display: grid; grid-template-columns: minmax(0,1fr); overflow: visible; gap: 16px; }
  .busan-story-track figure { width: 100%; height: auto; aspect-ratio: 4 / 3; }
  .busan-story-track figcaption { font-size: 14px; }
  .v20-timeline, .v19-process-nav { grid-template-columns: minmax(0,1fr); }
  .review-track { grid-template-columns: repeat(2,minmax(0,1fr)); padding-inline: 16px; }
  .busan-page .menu-toggle::before { display: block; }
}
@media (min-width: 768px) and (max-width: 1024px) {
  .v19-comparison table { min-width: 0; table-layout: fixed; }
  .v19-comparison :is(th,td) { overflow-wrap: anywhere; }
  .hero-blur-a { left: 0; }
}
@media (max-width: 767px) {
  main small { font-size: 13px !important; line-height: 1.6; }
  /* Long mobile sections must remain readable even before observer thresholds. */
  body .reveal { opacity: 1; transform: none; }
}
