/* Shared mobile layout, loaded after each page's legacy styles. */
@media (max-width:980px){
  html{scroll-padding-top:96px;scroll-padding-bottom:100px;-webkit-text-size-adjust:100%}
  body{padding-bottom:calc(92px + env(safe-area-inset-bottom,0px))!important}
  body *,body *::before,body *::after{box-sizing:border-box}
  main,section,article,.wrap,.hero-copy,.legal-content{min-width:0}
  h1,h2,h3,p,a,strong{overflow-wrap:break-word}
  img,video{max-width:100%}
  input,select,textarea{max-width:100%;font-size:16px!important}
  a,button,[role="button"]{touch-action:manipulation}
  a:focus-visible,button:focus-visible,[tabindex]:focus-visible{outline:3px solid #0050a4;outline-offset:4px}

  /* Keep the floating navigation clear of the phone's screen edges. */
  body #siteNav{top:calc(10px + env(safe-area-inset-top,0px))!important;left:max(12px,env(safe-area-inset-left,0px))!important;right:max(12px,env(safe-area-inset-right,0px))!important}
  body .mobile-bottom-nav.mobile-bottom-nav-svg{
    left:max(8px,env(safe-area-inset-left,0px))!important;
    right:max(8px,env(safe-area-inset-right,0px))!important;
    bottom:calc(8px + env(safe-area-inset-bottom,0px))!important;
    grid-template-columns:repeat(5,minmax(0,1fr))!important;
    gap:2px!important;padding:6px!important;
  }
  body .mobile-bottom-nav.mobile-bottom-nav-svg a{min-width:0;min-height:54px!important;padding:6px 1px!important;gap:5px!important}
  body .mobile-bottom-nav.mobile-bottom-nav-svg a small{font-size:.68rem!important;line-height:1.2!important;letter-spacing:0!important}
  body .mobile-bottom-nav .mobile-nav-icon,body .mobile-bottom-nav .mobile-nav-icon svg{width:22px!important;height:22px!important}

  /* Flexible headings and comfortable reading sizes. */
  body main > .hero{min-height:min(740px,82svh)!important;padding:112px 20px 38px!important;padding-top:calc(112px + env(safe-area-inset-top,0px))!important}
  body .hero h1{font-size:clamp(2.4rem,10.5vw,4.5rem)!important;line-height:1.04!important;letter-spacing:-.045em!important;hyphens:auto}
  body .hero-copy p{font-size:1rem!important;line-height:1.6!important}
  body .hero .eyebrow{max-width:100%;font-size:.75rem!important;line-height:1.5!important;white-space:normal!important}
  body .hero .actions{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}
  body .hero .actions .btn{min-height:48px!important;font-size:.9rem!important;white-space:normal!important;line-height:1.35!important}
  body .section-head{gap:14px!important}
  body .section-title,body #abteilungen .section-title{font-size:clamp(2rem,8.5vw,3.5rem)!important;line-height:1.1!important;letter-spacing:-.04em!important;hyphens:auto}
  body .section-head p,body .market-content p,body .service-content p,body .news-slide-content p{font-size:.95rem!important;line-height:1.6!important}
  body .btn,body .market-link,body .filter,body .contact-action{min-height:44px!important;white-space:normal!important}

  /* Give contact details their own row instead of squeezing them beside a button. */
  body .mini-strip{width:calc(100% - 32px)!important;grid-template-columns:1fr!important;gap:12px!important}
  body .mini-card,body #kontakt .contact-card{
    display:grid!important;grid-template-columns:40px minmax(0,1fr)!important;
    grid-template-rows:auto auto auto!important;gap:5px 12px!important;
    min-height:0!important;padding:18px!important;
  }
  body .mini-card > span,body #kontakt .contact-card > span{grid-column:1!important;grid-row:1 / 3!important;margin:0!important;width:40px!important;height:40px!important}
  body .mini-card > strong,body #kontakt .contact-card h3{grid-column:2!important;grid-row:1!important;font-size:1rem!important;line-height:1.4!important;overflow-wrap:anywhere}
  body .mini-card > p,body #kontakt .contact-card p{grid-column:2!important;grid-row:2!important;font-size:.9rem!important;line-height:1.55!important;overflow-wrap:anywhere}
  body .mini-card .card-actions,body #kontakt .contact-card .card-actions{grid-column:2!important;grid-row:3!important;flex-wrap:wrap!important;margin-top:8px!important;padding-top:0!important;gap:8px!important}
  body .mini-card .contact-action,body #kontakt .contact-card .contact-action{min-height:44px!important;padding:10px 14px!important;font-size:.85rem!important;line-height:1.35!important;white-space:normal!important}
  body .mini-card a.contact-action[href]::before{content:none!important}

  /* Consistent, compact pictures; retain the requested Fürth crop. */
  body #markets .market-image{height:180px!important;min-height:0!important}
  body #markets .market-card .market-image-fuerth{height:195px!important}
  body #markets .market-content,body #leistungen .service-content{padding:20px!important}
  body #markets .market-content h3{font-size:1.5rem!important;line-height:1.2!important}
  body #markets .market-link{display:inline-flex;align-items:center;font-size:.9rem!important}
  body #markets .market-card,body #leistungen .service-card,body #karriere .job-card{height:auto!important;min-height:0!important}

  /* Modals must scroll within the visible screen, above the bottom navigation. */
  body .gallery-modal,body .news-detail-modal,body .prospekt-market-modal{padding:12px!important;z-index:100000!important}
  body .gallery-modal-inner,body .news-detail-inner,body .prospekt-market-dialog{max-height:calc(100dvh - 24px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px))!important;overflow-y:auto!important;overscroll-behavior:contain}
  body .gallery-close,body .gallery-nav-btn,body .news-detail-close,body .prospekt-market-close,body .prospekt-reader-close{min-width:44px!important;min-height:44px!important}
  body .prospekt-reader-modal{padding:8px!important}
  body .prospekt-reader-dialog{height:calc(100dvh - 16px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px))!important;border-radius:22px!important}
  body .prospekt-market-dialog{padding:52px 20px 24px!important}
  body .prospekt-market-entry{min-width:0;gap:20px!important}
  body .prospekt-market-entry h2,body .prospekt-content h2{font-size:clamp(2rem,8vw,3.25rem)!important;line-height:1.1!important;max-width:100%!important}

  /* Jobs and legal pages have a shorter introductory panel. */
  body.standalone-page .wrap{margin-left:16px!important;margin-right:16px!important}
  body.standalone-page main > .hero{min-height:0!important;margin-top:100px!important;padding:32px 22px!important;border-radius:28px!important}
  body.standalone-page .hero h1{font-size:clamp(2rem,8.6vw,3.6rem)!important;overflow-wrap:anywhere}
  body.standalone-page .hero p{font-size:1rem!important;line-height:1.6!important;margin-top:20px!important}
  body.standalone-page .hero-actions{gap:10px;margin-top:24px}
  body.standalone-page .hero-actions .btn{flex:1 1 190px;padding:12px 18px}
  body.standalone-page .accent{max-width:65%;height:8px;margin-top:24px}
  body.standalone-page .legal-layout{grid-template-columns:minmax(0,1fr)!important;gap:20px;padding:32px 0 44px!important}
  body.standalone-page .toc{display:block!important;position:static;padding:20px!important}
  body.standalone-page .toc a{min-height:44px;display:flex;align-items:center;font-size:.95rem}
  body.standalone-page .chapter,body.standalone-page .legal-intro{padding:22px!important;overflow-wrap:anywhere;scroll-margin-top:96px}
  body.standalone-page .chapter h2{font-size:1.5rem;line-height:1.25;hyphens:auto}
  body.standalone-page .chapter p,body.standalone-page .chapter li{font-size:1rem;line-height:1.7}
  body.standalone-page .jobs{grid-template-columns:minmax(0,1fr)!important}
  body.standalone-page .filter-row{align-items:flex-start;gap:8px}
  body.standalone-page .filter-title{flex-basis:100%;margin-top:6px}
  body.standalone-page .filters{gap:8px}
  body.standalone-page .filter{padding:10px 14px;font-size:.9rem}
  body.standalone-page .apply{grid-template-columns:minmax(0,1fr)!important;padding:26px!important;gap:26px}
  body.standalone-page .apply h2{font-size:clamp(2rem,8vw,3rem);line-height:1.1;hyphens:auto}
  body.standalone-page .apply-action{padding:22px 0 0;border-left:0;border-top:1px solid rgba(0,80,164,.14)}

  body .site-footer{margin:24px 16px!important}
  body .site-footer .footer-main,body .site-footer .footer-bottom{padding:24px!important;display:block!important}
  body .site-footer .footer-brand h2{font-size:clamp(2rem,9vw,3.3rem)!important;line-height:1.05!important;letter-spacing:-.05em!important}
  body .site-footer .footer-brand p{font-size:.95rem!important;line-height:1.6!important}
  body .site-footer .footer-markets{display:flex!important;flex-wrap:wrap!important;justify-content:flex-start!important;padding:12px 20px!important;gap:4px!important}
  body .site-footer .footer-markets a,body .site-footer .footer-legal a{display:inline-flex;align-items:center;min-height:44px;font-size:.9rem!important}
  body .site-footer .footer-legal{justify-content:flex-start!important;flex-wrap:wrap;gap:8px 16px!important;margin-top:12px}

  /* Avoid scroll-triggered blank sections and expensive effects on phones. */
  body .reveal,body .reveal-item{opacity:1!important;transform:none!important;filter:none!important;transition:none!important}
  body .motion-orb,body .motion-noise,body .cursor-glow{display:none!important}
  body .cinema::before,body .hero-copy::before,body .ticker-track{animation:none!important}
}

@media (max-width:600px){
  body .hero .actions{grid-template-columns:minmax(0,1fr)!important}
  body.standalone-page .benefits{grid-template-columns:minmax(0,1fr)!important}
  body.standalone-page .job{grid-template-columns:44px minmax(0,1fr);gap:12px;padding:20px 16px}
  body.standalone-page .job-icon{width:44px;height:44px;font-size:1.4rem}
  body.standalone-page .job h3{font-size:1.2rem;line-height:1.3}
  body.standalone-page .job .arrow{display:none}
}

@media (hover:none) and (max-width:980px){
  body .tilt,body .magnetic,body .market-card:hover,body .service-card:hover,body .job:hover{transform:none!important}
}

/* Standalone and embedded PDF reader: controls stay usable on narrow screens. */
@media (max-width:700px){
  body:has(.reader){padding-bottom:0!important}
  body .reader{min-height:100svh;padding:8px;gap:8px;grid-template-rows:auto auto minmax(0,1fr) auto}
  body .reader-header{flex-wrap:wrap;gap:10px;padding:12px}
  body .reader-header .brand{min-width:0;gap:10px}
  body .reader-header a{display:inline-flex;align-items:center;min-height:44px;font-size:.85rem}
  body .reader-toolbar{display:grid;grid-template-columns:minmax(0,1fr);gap:8px;padding:8px}
  body .reader-toolbar .controls{flex-wrap:wrap;gap:6px;min-width:0}
  body .reader-toolbar button{min-width:44px;min-height:44px;padding:0 10px}
  body .reader-toolbar .page-label,body .reader-toolbar .zoom-label{min-width:58px}
  body .reader-stage{min-height:220px;height:calc(100svh - 260px);padding:8px;touch-action:pan-x pan-y pinch-zoom}
  body .reader-hint{font-size:.8rem;line-height:1.5}
  body .reader:fullscreen .reader-stage{height:calc(100dvh - 140px)}
}
