
/* Wimmer Community V6.67.18 - Global mobil stabilitet
   Formål: stop ryst/hop på mobil på både forside, chat og andre sider.
   Ændrer ikke database, brugerdata eller funktioner.
*/

@media (max-width: 900px) {
  html,
  body {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 100% !important;
    overflow-x: hidden !important;
    scroll-behavior: auto !important;
    overscroll-behavior-y: none !important;
    -webkit-text-size-adjust: 100% !important;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    box-sizing: border-box !important;
  }

  /* Stop layout-animationer der kan føles som rysten på mobil */
  .layout,
  .app-main,
  .app-shell,
  .app-content,
  main,
  .card,
  .wc-dashboard-v6675,
  .wc-groups-v66711,
  .profile-hero,
  .wc-profile-clean-layout,
  .wc-chat-mega,
  .wc-chat-panel,
  .wc-chat-messages,
  .wc-chat-compose {
    animation: none !important;
    transition-property: background-color, color, border-color, box-shadow, opacity !important;
    transform: none !important;
    will-change: auto !important;
  }

  /* Ingen elementer må presse siden bredere end skærmen */
  img,
  video,
  canvas,
  iframe,
  table,
  pre,
  code {
    max-width: 100% !important;
  }

  .layout,
  .app-main,
  .app-content,
  main {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  /* Sticky/fixed elementer skal ikke skabe vandret hop */
  .app-topbar,
  .app-sidebar,
  .mobile-header,
  .wc-mobile-bottom-nav,
  .wc-chat-top,
  .wc-chat-compose {
    max-width: 100vw !important;
    overflow-x: hidden !important;
    backface-visibility: hidden !important;
  }

  /* Chat specifikt: brug stabil svh i stedet for dynamisk dvh på mobil */
  body.wc-chat-standalone-open {
    overflow: hidden !important;
    height: 100svh !important;
    max-height: 100svh !important;
    position: relative !important;
  }

  body.wc-chat-standalone-open .layout,
  body.wc-chat-standalone-open .wc-chat-mega,
  body.wc-chat-standalone-open .wc-chat-panel {
    height: 100svh !important;
    max-height: 100svh !important;
    min-height: 100svh !important;
    overflow: hidden !important;
  }

  body.wc-chat-standalone-open .wc-chat-panel {
    display: flex !important;
    flex-direction: column !important;
  }

  body.wc-chat-standalone-open .wc-chat-top {
    flex: 0 0 auto !important;
  }

  body.wc-chat-standalone-open .wc-chat-messages {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
  }

  body.wc-chat-standalone-open .wc-chat-compose {
    flex: 0 0 auto !important;
    position: relative !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    min-height: 56px !important;
    height: auto !important;
    max-height: 62px !important;
    z-index: 9999 !important;
  }

  body.wc-chat-standalone-open .wc-chat-compose textarea,
  body.wc-chat-standalone-open textarea#chatBody {
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
    resize: none !important;
    overflow-y: auto !important;
    font-size: 16px !important;
  }

  body.wc-chat-standalone-open .wc-chat-compose textarea:focus,
  body.wc-chat-standalone-open textarea#chatBody:focus {
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
  }

  /* Forside/dashboard: undgå kort der prøver at animere/rette sig ind ved scroll */
  .wc-dashboard-card,
  .wc-dashboard-shortcut-card,
  .wc-dashboard-feed,
  .wc-dashboard-side,
  .wc-dashboard-widget,
  .wc-profile-clean-card,
  .wc-group-card-new {
    transform: none !important;
    animation: none !important;
    will-change: auto !important;
  }

  /* Hover-effekter på mobil kan give flimmer/hop */
  .wc-dashboard-shortcut-card:hover img,
  .wc-group-card-new:hover,
  .wc-profile-clean-card:hover,
  .wc-chat-thread:hover {
    transform: none !important;
  }
}

/* Ekstra lille skærm */
@media (max-width: 430px) {
  body.wc-chat-standalone-open .wc-chat-compose {
    max-height: 60px !important;
  }
}
