/* Mobile repair v3. Original desktop styling and supplied assets are retained. */
:root {
  --header-height: 84px;
  --bottom-bar-height: calc(76px + env(safe-area-inset-bottom, 0px));
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-height) + 16px);
  scroll-padding-bottom: calc(var(--bottom-bar-height) + 16px);
}
body { padding-bottom: var(--bottom-bar-height); }
button, a, summary { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.product-card[hidden], .dialog-backdrop[hidden] { display: none !important; }
.pill { min-height: 44px; }
.brand, .header-store, .header-download, .line-button { min-height: 44px; }
.header-store { display: inline-flex; align-items: center; }
.card-action { min-height: 44px; }
.faq summary { min-height: 44px; align-items: center; }
.faq summary::after { flex-shrink: 0; }
.footer { padding-bottom: 40px; }
.footer-links { gap: 6px 18px; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; }
.sticky-download {
  padding-top: 8px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
}
.sticky-cta, .btn-arr, .android-icon { flex-shrink: 0; }
.android-icon { display: inline-flex; align-items: center; }

/* Native and legacy dialogs use the same actual backdrop and scroll rules. */
html.modal-open { overflow: hidden; scroll-behavior: auto; }
.info-dialog:not([open]) { display: none; }
.info-dialog {
  width: min(445px, calc(100% - 32px));
  max-width: calc(100% - 32px);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.info-dialog::backdrop { background: rgba(23, 14, 10, .67); }
.info-dialog.compat-open {
  display: block;
  position: fixed;
  z-index: 1005;
  inset: 50% auto auto 50%;
  top: 50%;
  left: 50%;
  right: auto;
  bottom: auto;
  margin: 0;
  transform: translate(-50%, -50%);
  box-shadow: 0 30px 120px rgba(0, 0, 0, .35);
}
.dialog-backdrop { position: fixed; inset: 0; top: 0; right: 0; bottom: 0; left: 0; z-index: 1004; background: rgba(23, 14, 10, .67); }
.modal-content { padding-top: 62px; }
.modal-close { width: 44px; height: 44px; top: 10px; right: 10px; z-index: 2; }
.dialog-product { min-width: 0; gap: 12px; }
.dialog-product img { width: 90px; flex: 0 1 90px; }
.dialog-product > div { min-width: 0; }
.dialog-product strong { font-size: clamp(20px, 6vw, 24px); }

@media (max-width: 760px) {
  :root { --header-height: calc(120px + env(safe-area-inset-top, 0px)); }
  .shell {
    width: calc(100% - 32px);
    width: calc(100% - max(16px, env(safe-area-inset-left, 0px)) - max(16px, env(safe-area-inset-right, 0px)));
  }
  .site-header { padding-top: env(safe-area-inset-top, 0px); }
  .header-inner { min-height: 64px; padding-block: 8px; }
  .brand { flex-shrink: 1; }
  .brand small { line-height: 1.4; }
  .brand-mark { flex-shrink: 0; }
  .header-store { display: none; }
  .header-download { min-height: 44px; padding: 10px 12px; }
  .mobile-line-cta { min-height: 44px; }
  .hero h1 { overflow-wrap: anywhere; }
  .hero-cta { min-height: 64px; font-size: clamp(14px, 4.2vw, 17px); }
  .hero-cta > span:nth-child(2) { min-width: 0; }
  .hero-copy, .mid-copy, .final-inner { min-width: 0; }
  .hero-perks { gap: 6px; }
  .perks { padding-inline: 4px; }
  .perks b { min-width: 0; overflow-wrap: anywhere; }
  .pill-row { padding-top: 3px; padding-bottom: 8px; overscroll-behavior-x: contain; }
  .pill { min-height: 44px; }
  .card-brand { overflow-wrap: anywhere; }
  .card-action { white-space: normal; font-size: 12px; }
  .mid-copy h2, .mid-copy p { overflow-wrap: anywhere; }
  .final-cta { font-size: clamp(14px, 4.2vw, 18px); }
  .final-cta .btn-arr { width: 32px; height: 32px; }
  .feature-image img { object-fit: contain; }
  .step { grid-template-columns: 26px 42px minmax(0, 1fr); gap: 10px; }
  .sticky-inner { gap: 8px; }
  .sticky-brand { flex-shrink: 0; }
  .sticky-cta { font-size: clamp(12px, 3.3vw, 14px); min-width: 0; }
  .faq details { padding-block: 12px; }
}

/* Phones in landscape keep content usable instead of two tall sticky bars. */
@media (max-width: 900px) and (max-height: 500px) and (orientation: landscape) {
  .site-header { position: relative; }
  html { scroll-padding-top: 16px; }
  .hero-wrap { padding-top: 20px; }
  .sticky-brand .mini-bag { width: 30px; height: 30px; }
  .sticky-cta { min-height: 44px; }
  .sticky-brand small { display: none; }
  .info-dialog { max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); }
}

/* Tablet: avoid forcing four compact phone-sized cards into the desktop grid. */
@media (min-width: 761px) and (max-width: 1060px) {
  .shell {
    width: calc(100% - 40px);
    width: calc(100% - max(20px, env(safe-area-inset-left, 0px)) - max(20px, env(safe-area-inset-right, 0px)));
  }
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .product-card { display: flex; flex-direction: column; min-width: 0; }
  .card-detail { display: flex; flex-direction: column; flex: 1; }
  .card-action { margin-top: auto; }
  .hero h1 { font-size: clamp(30px, 3.8vw, 40px); }
  .sale-lockup { gap: 12px; }
  .sale-text strong { font-size: clamp(94px, 11vw, 116px); }
  .sale-side { font-size: 12px; padding-left: 10px; }
  .hero-cta { font-size: 16px; padding-inline: 12px; gap: 8px; }
  .hero-cta > span:nth-child(2) { min-width: 0; }
  .hero-media { height: 410px; }
  .portrait-panel { height: 345px; }
  .phone-panel { height: 385px; }
  .mid-inner { flex-wrap: wrap; }
  .mid-inner .btn-light { margin-left: 97px; }
}
@media (min-width: 761px) and (max-width: 900px) {
  .header-store { display: none; }
  .header-actions { gap: 10px; }
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 355px) {
  .header-download { padding-inline: 9px; }
  .card-action { font-size: 11px; }
  .sticky-brand .mini-bag { display: none; }
  .modal-content { padding-inline: 16px; }
  .dialog-product { gap: 8px; padding: 8px; }
  .dialog-product img { width: 76px; flex-basis: 76px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
