/* PEP-PUBLIC-COPY-MOBILE-HARDENING-22
 * Final plugin-owned mobile production contract.
 */
:root{
  --kbm-pcm-navy:#0b1f33;
  --kbm-pcm-navy-2:#12324f;
  --kbm-pcm-yellow:#ffc400;
  --kbm-pcm-bg:#f4f7fb;
  --kbm-pcm-border:#dce5ef;
  --kbm-pcm-muted:#64748b;
  --kbm-pcm-radius:18px;
  --kbm-pcm-touch:48px;
  --kbm-pcm-safe-bottom:env(safe-area-inset-bottom,0px);
  --kbm-pcm-vvh:100dvh;
}

/* Never expose development/QA surfaces on public pages. */
body.kbm-pcm-production :where(
  .kbm-health-panel,.kbm-admin-card,.kbm-p28-status,.kbm-layout-probe,
  .kbm-p0-detail-health,.kbm-p0-card,.kbm-rqa-wrap,.kbm-ai-sr-inline,
  [data-kbm-live-package],[class*="live-qa"],[class*="qa-marker"],
  [class*="debug-panel"],[class*="diagnostic-panel"],[class*="health-panel"],
  [class*="runtime-status"],[class*="phase-status"],[class*="checklist-panel"]
){display:none!important}

body.kbm-pcm-production{overflow-x:clip}
body.kbm-pcm-production *{box-sizing:border-box}
body.kbm-pcm-production :where(img,picture,video,canvas,svg,iframe){max-width:100%;height:auto}
body.kbm-pcm-production :where(.kbm-theme-container,.kbm-shell,.kbm-wrap,.kbm-container,.container,.site-main,main){min-width:0}
body.kbm-pcm-production :where(table){border-collapse:collapse}
body.kbm-pcm-production :where(a,button,input,select,textarea,[role="button"]){touch-action:manipulation}

@media (max-width:767px){
  html{font-size:16px;scroll-behavior:smooth;overflow-x:clip}
  body.kbm-pcm-production{
    width:100%;max-width:100%;min-width:0;margin:0;
    background:var(--kbm-pcm-bg);
    color:var(--kbm-pcm-navy);
    -webkit-text-size-adjust:100%;text-size-adjust:100%;
    overscroll-behavior-y:contain;
  }
  body.kbm-pcm-production.kbm-pcm-keyboard-open{padding-bottom:0!important}
  body.kbm-pcm-production :where(h1,h2,h3,h4,p,li,dt,dd,span,strong,b,a,label,button){overflow-wrap:anywhere}
  body.kbm-pcm-production :where(h1){font-size:clamp(1.45rem,6vw,1.9rem);line-height:1.45;margin-block:0 12px}
  body.kbm-pcm-production :where(h2){font-size:clamp(1.2rem,5vw,1.55rem);line-height:1.5;margin-block:0 10px}
  body.kbm-pcm-production :where(h3){font-size:1.05rem;line-height:1.55}
  body.kbm-pcm-production :where(p,li,label,input,select,textarea,button){font-size:16px;line-height:1.8}
  body.kbm-pcm-production :where(small,.meta,.kbm-meta,.kbm-muted){font-size:13px;line-height:1.7}

  body.kbm-pcm-production :where(
    main,.site-main,.kbm-theme-main,.kbm-theme-shell,.kbm-shell,.kbm-wrap,.kbm-container,
    .kbm-theme-container,.kbm-theme-content,.entry-content,.page-content,.elementor-section,
    .elementor-container,.elementor-widget-wrap
  ){
    width:100%;max-width:100%;min-width:0!important;
  }
  body.kbm-pcm-production :where(.kbm-theme-main,.site-main,main){padding-inline:0!important}
  body.kbm-pcm-production :where(.entry-content,.page-content,.kbm-theme-content){padding-inline:12px}
  body.kbm-pcm-production :where(.kbm-theme-container,.container){padding-inline:12px!important}

  body.kbm-pcm-production :where(
    input:not([type="checkbox"]):not([type="radio"]),select,textarea
  ){
    width:100%!important;max-width:100%!important;min-width:0!important;
    min-height:var(--kbm-pcm-touch);padding:12px 14px!important;
    border:1px solid var(--kbm-pcm-border)!important;border-radius:14px!important;
    background:#fff!important;color:var(--kbm-pcm-navy)!important;
    font:inherit!important;box-shadow:none!important;
  }
  body.kbm-pcm-production textarea{min-height:120px;resize:vertical}
  body.kbm-pcm-production :where(input,select,textarea):focus{
    outline:3px solid rgba(255,196,0,.22)!important;border-color:#e3ad00!important;
  }
  body.kbm-pcm-production :where(button,.button,.kbm-btn,[class*="-btn"],input[type="submit"]){
    min-height:var(--kbm-pcm-touch);max-width:100%;border-radius:14px;
    white-space:normal;line-height:1.5;font-weight:800;
  }
  body.kbm-pcm-production :where(form,fieldset,.kbm-form,.kbm-form-section,.kbm-form-card){min-width:0;max-width:100%}
  body.kbm-pcm-production :where(fieldset){margin:0 0 14px;padding:14px;border:1px solid var(--kbm-pcm-border);border-radius:var(--kbm-pcm-radius);background:#fff}
  body.kbm-pcm-production :where(label){display:block;margin-bottom:6px;font-weight:750;color:#20364e}
  body.kbm-pcm-production :where(.required,.kbm-required){color:#b4233d}

  /* Shared mobile cards. */
  body.kbm-pcm-production :where(
    .kbm-card,.kbm-ad-card,.kbm-adsv2-card,.kbm-driver-card,.kbm-tender-card,
    .kbm-dashboard-card,.kbm-life-card,.kbm-panel-card,.kbm-theme-content-card,
    article.kbm-theme-article,.kbm-empty-state,.kbm-filter-card
  ){
    width:100%!important;max-width:100%!important;min-width:0!important;
    margin-inline:0!important;border-radius:18px!important;
    box-shadow:0 8px 24px rgba(15,35,56,.07)!important;
    overflow:hidden!important;
  }
  body.kbm-pcm-production :where(
    .kbm-ad-grid,.kbm-adsv2-grid,.kbm-driver-grid,.kbm-tender-grid,.kbm-dashboard-grid,
    .kbm-life-grid,.kbm-cards,.kbm-grid,[class*="cards-grid"],[class*="archive-grid"]
  ){
    display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:12px!important;
    width:100%!important;max-width:100%!important;
  }

  /* Archive/list cards: app-like compact rows. */
  body.kbm-pcm-route-ads :where(.kbm-ad-card,.kbm-adsv2-card),
  body.kbm-pcm-route-drivers :where(.kbm-driver-card),
  body.kbm-pcm-route-tenders :where(.kbm-tender-card){
    display:grid!important;grid-template-columns:112px minmax(0,1fr)!important;
    align-items:stretch!important;min-height:128px!important;background:#fff!important;
  }
  body.kbm-pcm-route-ads :where(.kbm-ad-card-media,.kbm-adsv2-card-media,figure,.card-media),
  body.kbm-pcm-route-drivers :where(.kbm-driver-card__media,.kbm-driver-media,figure),
  body.kbm-pcm-route-tenders :where(.kbm-tender-card__media,figure){
    width:112px!important;height:100%!important;min-height:128px!important;margin:0!important;
    border-radius:0!important;background:#e8eef5!important;overflow:hidden!important;
  }
  body.kbm-pcm-route-ads :where(.kbm-ad-card-media img,.kbm-adsv2-card-media img,figure img,.card-media img),
  body.kbm-pcm-route-drivers :where(.kbm-driver-card__media img,.kbm-driver-media img,figure img),
  body.kbm-pcm-route-tenders :where(.kbm-tender-card__media img,figure img){
    width:100%!important;height:100%!important;object-fit:cover!important;display:block!important;
  }
  body.kbm-pcm-route-ads :where(.kbm-ad-card-body,.kbm-adsv2-card-body,.card-body),
  body.kbm-pcm-route-drivers :where(.kbm-driver-card__body,.kbm-driver-body),
  body.kbm-pcm-route-tenders :where(.kbm-tender-card__body,.kbm-tender-body){
    min-width:0!important;padding:12px!important;display:flex!important;flex-direction:column!important;gap:7px!important;
  }
  body.kbm-pcm-production :where(.kbm-ad-card h2,.kbm-ad-card h3,.kbm-adsv2-card h2,.kbm-adsv2-card h3,.kbm-driver-card h2,.kbm-driver-card h3,.kbm-tender-card h2,.kbm-tender-card h3){
    display:-webkit-box!important;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;
    font-size:15px!important;line-height:1.65!important;margin:0!important;
  }
  body.kbm-pcm-production :where(.kbm-card-actions,.kbm-ad-card-actions,.kbm-driver-card-actions,.kbm-tender-card-actions){
    margin-top:auto!important;display:flex!important;gap:8px!important;flex-wrap:wrap!important;
  }
  body.kbm-pcm-production :where(.kbm-card-actions a,.kbm-card-actions button,.kbm-ad-card-actions a,.kbm-driver-card-actions a,.kbm-tender-card-actions a){
    flex:1 1 auto;min-height:42px!important;padding:8px 10px!important;
  }

  /* Filters become a safe bottom sheet when their controllers open them. */
  body.kbm-pcm-production :where(
    .kbm-filter-panel,.kbm-filters,.kbm-archive-filters,.kbm-adsv2-filters,
    .kbm-driver-filters,.kbm-tender-filters,.kbm-ads-recode-filter
  ){
    max-width:100%!important;min-width:0!important;
  }
  body.kbm-pcm-production.kbm-pcm-filter-open :where(
    .kbm-filter-panel,.kbm-filters,.kbm-archive-filters,.kbm-adsv2-filters,
    .kbm-driver-filters,.kbm-tender-filters,.kbm-ads-recode-filter
  ){
    position:fixed!important;z-index:100040!important;inset:auto 0 0 0!important;
    max-height:min(86dvh,760px)!important;overflow:auto!important;
    padding:18px 14px calc(18px + var(--kbm-pcm-safe-bottom))!important;
    background:#fff!important;border-radius:22px 22px 0 0!important;
    box-shadow:0 -18px 50px rgba(8,30,50,.24)!important;
  }
  body.kbm-pcm-production .kbm-pcm-backdrop{
    position:fixed;z-index:100030;inset:0;background:rgba(5,20,34,.52);
    opacity:0;visibility:hidden;pointer-events:none;transition:.2s ease;
  }
  body.kbm-pcm-production.kbm-pcm-filter-open .kbm-pcm-backdrop{opacity:1;visibility:visible;pointer-events:auto}

  /* Single rental and driver pages. */
  body.kbm-pcm-route-ad-single :where(.kbm-gallery,.kbm-ad-gallery,.kbm-ad-single-gallery,[data-kbm-gallery-main]),
  body.kbm-pcm-route-driver-single :where(.kbm-driver-hero-media,.kbm-driver-photo){
    width:100%!important;aspect-ratio:4/3!important;max-height:72dvh!important;
    border-radius:18px!important;overflow:hidden!important;background:#eaf0f6!important;
  }
  body.kbm-pcm-route-ad-single :where(.kbm-gallery img,.kbm-ad-gallery img,.kbm-ad-single-gallery img,[data-kbm-gallery-main] img),
  body.kbm-pcm-route-driver-single :where(.kbm-driver-hero-media img,.kbm-driver-photo img){width:100%!important;height:100%!important;object-fit:cover!important}
  body.kbm-pcm-production :where(.kbm-price-box,.kbm-ad-price,.kbm-owner-price,.kbm-single-price){
    width:100%!important;border-radius:18px!important;padding:14px!important;
  }
  body.kbm-pcm-production :where(.kbm-facts,.kbm-spec-grid,.kbm-ad-facts,.kbm-driver-facts){
    display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important;
  }
  body.kbm-pcm-production :where(.kbm-facts>*,.kbm-spec-grid>*,.kbm-ad-facts>*,.kbm-driver-facts>*){min-width:0!important;padding:10px!important;border-radius:12px!important}

  /* Submit/auth: one clean focus surface and always-visible final action. */
  body.kbm-pcm-route-auth :where(.kbm-v08-footer,.kbm-quf-app-bar),
  body.kbm-pcm-route-submit :where(.kbm-v08-footer,.kbm-quf-app-bar){display:none!important}
  body.kbm-pcm-route-auth :where(.kbm-auth-shell,.kbm-login-shell,.kbm-auth-card,.kbm-login-card,.kbm-p8-auth),
  body.kbm-pcm-route-submit :where(.kbm-submit-recode,.kbm-submit-shell,.kbm-submit-form-wrap,.kbm-form-shell){
    width:calc(100% - 24px)!important;max-width:720px!important;margin:12px auto!important;
    border-radius:22px!important;
  }
  body.kbm-pcm-route-submit :where(.kbm-submit-recode-form,.kbm-submit-form,form[data-kbm-submit]){padding-bottom:110px!important}
  body.kbm-pcm-route-submit :where(.kbm-submit-section,.kbm-submit-step,.kbm-form-section){
    padding:14px!important;margin-bottom:12px!important;border-radius:18px!important;background:#fff!important;
  }
  body.kbm-pcm-route-submit :where(.kbm-submit-actions,.kbm-submit-dock,.kbm-final-actions,[data-kbm-final-actions]){
    position:sticky!important;z-index:80!important;bottom:0!important;
    display:grid!important;grid-template-columns:1fr!important;gap:8px!important;
    width:100%!important;padding:10px 12px calc(10px + var(--kbm-pcm-safe-bottom))!important;
    margin:14px 0 0!important;background:rgba(255,255,255,.96)!important;
    backdrop-filter:blur(16px);border-top:1px solid var(--kbm-pcm-border)!important;
  }
  body.kbm-pcm-route-submit :where(button[type="submit"],input[type="submit"],[data-kbm-final-submit]){
    display:inline-flex!important;visibility:visible!important;opacity:1!important;
    align-items:center!important;justify-content:center!important;width:100%!important;
    min-height:52px!important;background:var(--kbm-pcm-yellow)!important;color:#0b1f33!important;
    border:0!important;border-radius:15px!important;font-weight:900!important;
  }
  body.kbm-pcm-route-submit :where(button[type="submit"][disabled],input[type="submit"][disabled]){opacity:.55!important}

  /* Dashboard. */
  body.kbm-pcm-route-dashboard :where(.kbm-dashboard-tabs,.kbm-life-tabs,[role="tablist"]){
    display:flex!important;gap:8px!important;overflow-x:auto!important;scroll-snap-type:x proximity;
    padding:4px 12px 10px!important;scrollbar-width:none;
  }
  body.kbm-pcm-route-dashboard :where(.kbm-dashboard-tabs>*,.kbm-life-tabs>*,[role="tab"]){flex:0 0 auto!important;scroll-snap-align:start;min-height:44px!important}
  body.kbm-pcm-route-dashboard :where(.kbm-dashboard-card,.kbm-life-card){display:grid!important;grid-template-columns:96px minmax(0,1fr)!important;gap:0!important}
  body.kbm-pcm-route-dashboard :where(.kbm-dashboard-card img,.kbm-life-card img){width:96px!important;height:100%!important;min-height:116px!important;object-fit:cover!important}

  /* Horizontal data structures are explicitly scrollable, never the page. */
  body.kbm-pcm-production :where(.table-responsive,.kbm-table-scroll,.kbm-core-table-scroll,.kbm-pcm-table-scroll){
    display:block;width:100%;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;border-radius:14px;
  }
  body.kbm-pcm-production :where(.table-responsive table,.kbm-table-scroll table,.kbm-core-table-scroll table,.kbm-pcm-table-scroll table){min-width:640px}

  /* Footer groups remain readable and compact. */
  body.kbm-pcm-production :where(.kbm-v08-footer__grid){display:grid!important;grid-template-columns:1fr!important;gap:0!important}
  body.kbm-pcm-production :where(.kbm-v08-footer__links,.kbm-v08-footer__contact,.kbm-v08-footer__social){
    border-top:1px solid rgba(255,255,255,.12);padding-block:14px!important;
  }
  body.kbm-pcm-production :where(.kbm-v08-footer__links>a,.kbm-v08-footer__contact>a){min-height:42px;align-items:center}

  @supports (height:100svh){:root{--kbm-pcm-vvh:100svh}}
}

@media (max-width:430px){
  body.kbm-pcm-production :where(.entry-content,.page-content,.kbm-theme-content,.kbm-theme-container,.container){padding-inline:10px!important}
  body.kbm-pcm-route-ads :where(.kbm-ad-card,.kbm-adsv2-card),
  body.kbm-pcm-route-drivers :where(.kbm-driver-card),
  body.kbm-pcm-route-tenders :where(.kbm-tender-card){grid-template-columns:104px minmax(0,1fr)!important}
  body.kbm-pcm-route-ads :where(.kbm-ad-card-media,.kbm-adsv2-card-media,figure,.card-media),
  body.kbm-pcm-route-drivers :where(.kbm-driver-card__media,.kbm-driver-media,figure),
  body.kbm-pcm-route-tenders :where(.kbm-tender-card__media,figure){width:104px!important}
  body.kbm-pcm-production :where(.kbm-facts,.kbm-spec-grid,.kbm-ad-facts,.kbm-driver-facts){grid-template-columns:1fr!important}
}

@media (orientation:landscape) and (max-height:520px) and (max-width:960px){
  body.kbm-pcm-production.kbm-pcm-keyboard-open .kbm-quf-app-bar{display:none!important}
  body.kbm-pcm-production :where(.kbm-filter-panel,.kbm-filters,.kbm-archive-filters){max-height:92dvh!important}
}

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