.mpt-mobile-menu {
  display: none;
}

.pulse-install {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px 12px;
  box-sizing: border-box;
  width: min(680px, calc(100% - 32px));
  margin: 12px auto;
  padding: 12px 14px;
  border: 1px solid var(--mp-line, #293d59);
  border-radius: 14px;
  background: var(--surface, #101f3d);
  color: var(--text, #f4f8fc);
  text-align: left;
  font-size: 14px;
}

.login-card .pulse-install {
  width: 100%;
  margin: 16px 0 0;
}

.pulse-install p {
  margin: 3px 0 0;
  color: var(--muted, #a8bad0);
  font-size: 13px;
  line-height: 1.45;
}

.pulse-install button {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--mp-line, #293d59);
  border-radius: 10px;
  color: inherit;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.pulse-install .pulse-install-action {
  padding: 6px 12px;
  border-color: #0297de;
  background: #0297de;
  color: #0a1430;
  font-weight: 700;
}

.pulse-install .pulse-install-close {
  font-size: 22px;
}

@media (max-width: 760px) {
  :root {
    --mpt-mobile-header-height: 96px;
  }

  html body.mpt-enabled > .mpt-header {
    grid-template-columns: minmax(44px, 1fr) max-content !important;
    grid-template-rows: 44px 44px !important;
    gap: 0 6px !important;
    height: var(--mpt-mobile-header-height) !important;
    max-height: none !important;
    padding-block: 4px !important;
    padding-inline: 8px !important;
    overflow: visible !important;
  }

  html body.mpt-enabled > .mpt-header > .mpt-controls {
    grid-area: 1 / 2 !important;
    border-left: 0 !important;
    padding-left: 0 !important;
  }

  html body.mpt-enabled .mpt-header .user-label {
    display: none !important;
  }

  .mpt-header .mpt-mobile-menu {
    grid-area: 2 / 1;
    justify-self: start;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--mp-line);
    border-radius: 10px;
    background: var(--surface, #101f3d);
    color: var(--text, #f4f8fc);
  }

  html body.mpt-enabled > .mpt-header > .mpt-navigation {
    position: absolute !important;
    grid-area: auto !important;
    inset: 100% 0 auto !important;
    display: none !important;
    flex-direction: column !important;
    align-items: stretch !important;
    height: auto !important;
    max-height: calc(100vh - var(--mpt-mobile-header-height)) !important;
    max-height: calc(100dvh - var(--mpt-mobile-header-height)) !important;
    padding: 12px !important;
    padding-bottom: max(12px, env(safe-area-inset-bottom)) !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    background: var(--mp-bg, #0a1430);
    box-shadow: 0 12px 24px #0005;
  }

  html body.mpt-enabled > .mpt-header > .mpt-mobile-menu[aria-expanded="true"] + .mpt-navigation {
    display: flex !important;
  }

  html body.mpt-enabled .mpt-header :is(.mpt-toggle, .mpt-direct) {
    justify-content: space-between !important;
    width: 100% !important;
    height: auto !important;
    min-height: 44px !important;
    padding: 8px 12px !important;
    font-size: 14px !important;
  }

  html body.mpt-enabled .mpt-header .mpt-toggle::before {
    display: none !important;
  }

  html body.mpt-enabled .mpt-header .mpt-toggle::after {
    display: block !important;
    content: '⌄' !important;
    color: currentColor;
  }

  html body.mpt-enabled .mpt-header .mpt-panel {
    position: static !important;
    width: auto !important;
    max-height: none !important;
    padding: 6px 0 8px 12px !important;
  }

  html body.mpt-enabled .mpt-header .mpt-panel .mpt-item {
    animation: none !important;
  }

  html body .wbc-embed .wbc-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .wbc-embed .wbc-detail-head {
    flex-wrap: wrap;
  }

  html body.mpt-enabled #page-content .metric-grid > .metric {
    min-width: 0;
    padding: 12px;
  }

  html body.mpt-enabled #page-content .metric-grid > .metric .metric-value {
    font-size: clamp(20px, 5.6vw, 27px) !important;
    white-space: normal;
  }

  html body.mpt-enabled :is(.metric-value, .metric-title, .metric-note, .metric-comparison, .platform-sum, .purchase-stat) {
    overflow-wrap: anywhere;
  }

  html body.mpt-enabled .platform-info {
    flex-wrap: wrap;
    gap: 4px 12px;
  }

  .purchase-tools select {
    min-width: 0;
  }

  body.login-body {
    padding: 16px;
    overflow-x: clip;
    overflow-y: auto;
  }

  body.login-body .login-card {
    padding: 24px;
  }

  .login-card input {
    min-height: 44px;
    font-size: 16px;
  }
}

@media (max-width: 440px) {
  .pulse-install {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .pulse-install-action {
    grid-area: 2 / 1;
    justify-self: start;
  }

  .pulse-install-close {
    grid-area: 1 / 2;
    align-self: start;
  }
}

@media (max-width: 420px) {
  html body.mpt-enabled > .mpt-header > .mpt-controls {
    gap: 4px !important;
  }

  .wc-dates {
    grid-template-columns: minmax(0, 1fr);
  }

  .wc-dates input {
    min-width: 0;
    max-width: 100%;
  }
}

@media (max-width: 360px) {
  html body.mpt-enabled #page-content .metric-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

#wb-bulk-prices {
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 1px solid var(--mp-line, var(--line));
  border-radius: 12px;
}
#wb-bulk-prices h3 { margin: 0 0 10px; }
.wb-bulk-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px 12px;
}
.wb-bulk-controls .edit-field { max-width: 180px; }
.wb-bulk-controls button { white-space: normal; }
.wb-bulk-check { margin-top: 10px; }
.wb-bulk-result, .wb-bulk-status-note { margin: 8px 0 0; overflow-wrap: anywhere; }
.wb-bulk-progress { margin-top: 14px; overflow-wrap: anywhere; }
.wb-bulk-progress progress { display: block; width: min(100%, 420px); margin-top: 6px; accent-color: var(--accent); }
.wb-bulk-progress p { margin: 6px 0; }
.wb-bulk-progress ul { padding-inline-start: 20px; }
.wb-bulk-progress summary { cursor: pointer; }
.wb-bulk-progress p:empty, .wb-bulk-result:empty, .wb-bulk-status-note:empty { display: none; }
.wb-bulk-preview { margin-top: 12px; overflow-wrap: anywhere; }
.wb-bulk-preview ul { padding-inline-start: 20px; }

@media (max-width: 760px) {
  .mp-mobile-note {
    min-width: 0;
    margin: 4px 0;
  }
  .mp-mobile-note > summary {
    width: fit-content;
    max-width: 100%;
    padding: 4px 0;
    cursor: pointer;
    font-size: 12px;
    color: var(--muted);
  }
  .mp-mobile-note > :is(p, .section-intro) {
    margin: 6px 0;
    overflow-wrap: anywhere;
  }
}
