/* r11-qa: visual fixes on M5 r10. Display / hit-target / overflow only. */

/* Item 2: phone card overlay (.mk800-rgc) was intercepting taps; chips must receive them */
@media (max-width: 640px) {
  .mk800-rgc,
  [data-mk800="rgc"],
  .pgb3-rgc {
    pointer-events: none !important;
  }
  .mk800-rgc .pgb3-chip,
  .mk800-rgc [data-ct1026],
  .mk800-rgc [data-pgb3],
  .mk800-rgc button,
  .mk800-rgc [role="button"],
  .pgb3-chip,
  [data-pgb3="card"] button,
  [data-pgb3="card"] [role="button"] {
    position: relative !important;
    z-index: 9 !important;
    pointer-events: auto !important;
  }
  .mk800-hero .pv-menu { pointer-events: auto; }
}

/* Item 3: long group/role names truncate instead of overflowing the panel */
.mk800-chips,
[data-mk800="chips"],
.ab939-panel,
[data-pgm5="grc"] {
  max-width: 100%;
  overflow: hidden;
}
.mk800-chips .pgb3-chip,
.mk800-chips [data-name],
[data-pgm5="grc"] button,
[data-pgm5="grc"] .pgb3-tx,
.ab939-panel [data-name],
[data-v757-day] {
  max-width: min(100%, 28rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pgm5-longname,
[data-r11="longname"] {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

/* Item 9: phone tile labels and Photos toggle */
@media (max-width: 640px) {
  .mk800-tile .mk800-tp,
  [data-mk800="tiles"] .mk800-tp {
    font-size: 10px !important;
    letter-spacing: -0.15px;
    text-overflow: ellipsis !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    max-width: 100%;
  }
  .mk800-tiles,
  [data-mk800="tiles"] {
    min-width: 0;
  }
  /* Photos toggle should not clip */
  .mk800-chips,
  [data-mk800="chips"] {
    -webkit-mask-image: none !important;
    mask-image: none !important;
    padding-right: 8px !important;
    flex-wrap: wrap;
  }
  /* sticky person bar should not cover content */
  .pv-fab,
  [data-mk800="sticky"],
  .mk800-sticky {
    bottom: calc(12px + env(safe-area-inset-bottom)) !important;
  }
  .mk800-root,
  [data-mk800="root"] {
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
  }
}

/* Item 4: email button contrast when previewed in inbox.
   Primary green must be #166534 (white on it is 7.1:1), never #16a34a. */
a.acc7,
.acc7,
[data-r11="mail-btn"],
a[style*="#16a34a"],
a[style*="16a34a"] {
  background: #166534 !important;
  color: #fff !important;
  text-decoration: none !important;
}

/* Item 3: assign dropdown / bottom sheet must stay in viewport */
[data-radix-popper-content-wrapper],
[role="dialog"] [data-r11="longname"],
[data-mk-title] {
  max-width: min(100vw - 24px, 28rem);
  overflow-wrap: anywhere;
  word-break: break-word;
}
