/* FISCHRAINE — Phase 135 iOS + Android optimization */
:root{
  --fr-safe-top: env(safe-area-inset-top, 0px);
  --fr-safe-right: env(safe-area-inset-right, 0px);
  --fr-safe-bottom: env(safe-area-inset-bottom, 0px);
  --fr-safe-left: env(safe-area-inset-left, 0px);
}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%;scroll-behavior:smooth}
html,body{max-width:100%;overflow-x:hidden}
body{min-height:100svh;min-height:100dvh;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}
img,svg,video,canvas{max-width:100%;height:auto}
button,a,input,select,textarea{-webkit-tap-highlight-color:transparent}
button,a,[role="button"]{touch-action:manipulation}
input,select,textarea{font-size:16px;max-width:100%}
@supports (-webkit-touch-callout:none){input,select,textarea{font-size:16px}}

/* Comfortable touch targets without visually inflating desktop controls. */
@media (pointer:coarse){
  button,.value-range-btn,.mobile-menu-toggle,.value-back,.collection-category-card a,.sport-card a{min-height:44px}
  a{cursor:pointer}
}

/* Tablet / phone shell */
@media (max-width:1024px){
  .site-header,.studio-header,.gateway-header{padding-left:max(20px,var(--fr-safe-left));padding-right:max(20px,var(--fr-safe-right))}
  .collection-value-page,.studio-page,main{min-width:0}
  .value-hero-grid,.value-section-head{grid-template-columns:1fr!important;gap:24px!important}
  .value-hero-copy{margin-left:0!important;max-width:680px!important}
  .value-metrics{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .value-metric:nth-child(2n){border-right:0!important}
  .value-section{padding-left:max(24px,var(--fr-safe-left))!important;padding-right:max(24px,var(--fr-safe-right))!important}
  .value-chart-card{max-width:100%!important}
  .value-chart-pro{width:100%!important;min-width:0!important}
}

/* Phones */
@media (max-width:720px){
  body{padding-bottom:var(--fr-safe-bottom)}
  .site-header,.studio-header,.gateway-header{padding-left:max(16px,var(--fr-safe-left));padding-right:max(16px,var(--fr-safe-right))}
  .brand-lockup,.brand-environment{min-width:0}
  .brand-name{white-space:nowrap}
  .fr-mark-logo{flex:0 0 auto}

  /* Collection + Value */
  .collection-value-page{padding-bottom:calc(72px + var(--fr-safe-bottom))!important}
  .value-topbar{top:0!important;padding:12px max(16px,var(--fr-safe-right)) 12px max(16px,var(--fr-safe-left))!important;gap:12px!important}
  .value-topbar-meta{font-size:.54rem!important;line-height:1.35!important}
  .value-hero{padding:48px max(16px,var(--fr-safe-right)) 28px max(16px,var(--fr-safe-left))!important}
  .value-hero h1{font-size:clamp(3.5rem,18vw,6rem)!important;line-height:.82!important}
  .value-metrics{grid-template-columns:1fr 1fr!important}
  .value-metric{min-height:116px!important;padding:20px 16px!important}
  .value-section{padding-left:max(16px,var(--fr-safe-left))!important;padding-right:max(16px,var(--fr-safe-right))!important}
  .value-section-head h2{font-size:clamp(2.8rem,14vw,4.8rem)!important;line-height:.88!important}
  #collectionValueChart .value-chart-card{padding:16px 14px 12px!important}
  #collectionValueChart .value-chart-pro{height:220px!important}
  #collectionValueView .value-chart-controls{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:6px!important;width:100%!important}
  #collectionValueView .value-range-btn{padding:10px 4px!important;min-width:0!important;width:100%!important}
  .value-row{grid-template-columns:34px minmax(0,1fr) 72px!important;gap:8px!important}
  .value-row-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

  /* Five sports / category cards: horizontal swipe is more usable than squeezed tiles. */
  .collection-categories,.sport-grid,.category-grid{scroll-snap-type:x mandatory;-webkit-overflow-scrolling:touch}
  .collection-categories > *, .sport-grid > *, .category-grid > *{scroll-snap-align:start}

  /* Collector Build inclusion cards */
  .studio-services{grid-template-columns:1fr!important;gap:8px!important}
  .studio-service-card{display:block!important;min-height:0!important;padding:16px 17px!important}
  .studio-service-card > div{display:block!important;width:100%!important}
  .studio-service-card strong{display:block!important;margin:0 0 7px!important;white-space:normal!important;word-break:normal!important}
  .studio-service-card small{display:block!important;max-width:none!important;width:100%!important;white-space:normal!important;word-break:normal!important;overflow-wrap:break-word!important;line-height:1.5!important}

  /* Bottom / floating UI must clear iPhone home indicator. */
  .mobile-menu,.mobile-dock,.hb-mobile-dock,.handbook-mobile-menu{padding-bottom:max(12px,var(--fr-safe-bottom))!important}
}

@media (max-width:480px){
  .value-metrics{grid-template-columns:1fr!important}
  .value-metric{border-right:0!important;border-bottom:1px solid #d6d1c8}
  .value-chart-card-head{display:block!important}
  .value-chart-card-change{margin-top:8px!important}
  #collectionValueChart .value-chart-pro{height:200px!important}
  .studio-service-card{padding:15px!important}
}

/* Landscape phones: reduce vertical waste while preserving safe areas. */
@media (max-height:520px) and (orientation:landscape){
  .value-hero{padding-top:30px!important}
  .site-header,.studio-header{min-height:56px!important}
}

@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  *,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}
}
