/* Shop space on phones: readable fields, 44px touch targets and dialogs kept
   inside the area left visible by the keyboard (see shop-mobile-v1.js). */
@media (max-width: 700px) {
  /* 16px prevents Safari's focus zoom without restricting user zoom. */
  .mp-app.mp-shop :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), textarea, select) {
    font-size: 16px !important;
    max-width: 100%;
    min-width: 0;
    scroll-margin-block: 80px;
  }
  .mp-app.mp-shop :is(button, a, summary) { touch-action: manipulation; }
  .mp-app.mp-shop :is(.mp-toolbar, .mp-module-hero, .mp-section-title) { min-width: 0; }
  .mp-app.mp-shop :is(.mp-filter-select, .mp-back-link, .mp-inbox-filters button, .sx-tabs button) { min-height: 44px; }
  .mp-app.mp-shop :is(.mp-toolbar, .mp-quick-actions) .mp-button {
    max-width: 100%;
    white-space: normal;
  }

  /* Keep the client, next action and measurements readable on narrow phones. */
  .mp-app.mp-shop .mp-analysis-list > button {
    grid-template-columns: 24px minmax(0, 1fr) 64px 16px;
    gap: 10px 8px;
    align-items: start;
  }
  .mp-app.mp-shop .mp-analysis-list > button > .mp-rank { grid-area: 1 / 1; }
  .mp-app.mp-shop .mp-analysis-list > button > span:nth-of-type(3) { grid-area: 1 / 2 / 2 / 4; }
  .mp-app.mp-shop .mp-analysis-list > button > .mp-analysis-statuses {
    grid-area: 2 / 2 / 3 / 4;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
  }
  .mp-app.mp-shop .mp-analysis-list > button > .mp-analysis-result { grid-area: 3 / 2; }
  .mp-app.mp-shop .mp-analysis-list > button > span:nth-of-type(5) { grid-area: 3 / 3; }
  .mp-app.mp-shop .mp-analysis-list > button > svg { grid-area: 1 / 4 / 4 / 5; align-self: center; }
  .mp-app.mp-shop .mp-analysis-list :is(b, small) { white-space: normal; overflow-wrap: anywhere; }
  .mp-app.mp-shop dialog:is(.shop-window, .mp-appointment-dialog, .sav-resolution-dialog, .assistant-dialog, .ow-offer-dialog) {
    top: calc(var(--shop-visible-top, 0px) + 8px);
    bottom: auto;
    margin: 0 auto;
    width: calc(100% - 16px);
    max-width: calc(100% - 16px);
    max-height: calc(var(--shop-visible-height, 100dvh) - 16px);
    overscroll-behavior: contain;
  }
  .mp-app.mp-shop .shop-window-heading { gap: 12px; }
  .mp-app.mp-shop .shop-window-heading > button { width: 44px; height: 44px; }
  .mp-app.mp-shop .shop-window-heading h2 { min-width: 0; overflow-wrap: anywhere; }
  .mp-app.mp-shop .shop-window-body { padding-bottom: max(16px, env(safe-area-inset-bottom)); }
  .mp-app.mp-shop .mp-appointment-dialog > header {
    position: sticky;
    top: 0;
    z-index: 5;
    padding-block: 8px;
    background: #fff;
  }
  .mp-app.mp-shop .sav-create-footer { gap: 8px; }
  .mp-app.mp-shop .mp-main { padding-bottom: env(safe-area-inset-bottom); }
  .mp-app.mp-shop .mp-conversation > header :is(.mp-inbox-back, .mp-thread-client),
  .mp-app.mp-shop .mp-composer button {
    min-width: 44px;
    min-height: 44px;
  }
  .mp-app.mp-shop.mp-app--assistants {
    height: var(--shop-visible-height, 100dvh);
  }
}
@media (min-width: 701px) and (max-width: 940px) {
  .mp-app.mp-shop :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), textarea, select) { font-size: 16px !important; }
}
