/* The phone's Categories panel (opened by the icon beside the search icon): a full-screen sheet under the site header with every category and filter, a bar with Clear all and Show N models at the bottom.
   Colours: the site's own variables only. Phones only. */
.mp { display: none; }
@media (max-width: 899px) {
  .mp:not([hidden]) { position: fixed; top: var(--ch-h, 54px); right: 0; bottom: 0; left: 0; z-index: 1005; display: flex; flex-direction: column; background: var(--msg-bg); color: var(--msg-text); }
  body.acct-bn-on .mp:not([hidden]) { top: calc(var(--ch-h, 54px) + var(--acct-bn)); }
  body.mp-open { overflow: hidden; }
  .mp:not([hidden]) { animation: mp-down .22s cubic-bezier(.2, .85, .25, 1); } /* slides down from under the header into place, quickly */
  @keyframes mp-down { from { transform: translateY(-100%); } to { transform: none; } }
  @media (prefers-reduced-motion: reduce) { .mp:not([hidden]) { animation: none; } }
  .mp-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; padding-bottom: 96px; }
  .mp-sec { border-bottom: 1px solid var(--msg-border); }
  .mp-sec > summary { display: flex; align-items: center; gap: 10px; min-height: calc(var(--mp-h, 36px) + 14px); padding: 0 18px; font-size: calc(var(--mp-fs, 14px) + 2px); font-weight: 700; cursor: pointer; list-style: none; }
  .mp-sec > summary::-webkit-details-marker { display: none; }
  .mp-sec > summary > span { flex: 1; }
  .mp-sec > summary::after { content: ""; flex: none; width: 10px; height: 10px; border-right: 2px solid var(--msg-muted); border-bottom: 2px solid var(--msg-muted); transform: rotate(45deg) translate(-3px, -3px); transition: transform .15s; }
  .mp-sec[open] > summary::after { transform: rotate(-135deg) translate(-3px, -3px); }
  .mp-n { flex: none; min-width: 24px; height: 24px; padding: 0 7px; box-sizing: border-box; border-radius: 12px; background: var(--msg-accent); color: var(--msg-on-accent); font-size: 14px; line-height: 24px; text-align: center; }
  .mp-sec-b { padding: 4px 18px 18px; }
  .mp-sub { margin: 12px 0 8px; color: var(--msg-muted); font-size: 14px; font-weight: 700; }
  .mp-chips, .mp-sec-b:not(:has(.mp-chips)) { display: flex; flex-wrap: wrap; gap: 8px; }
  .mp-chip { display: inline-flex; align-items: center; gap: 8px; min-height: var(--mp-h, 36px); padding: 0 calc(var(--mp-h, 36px) * .38); border-radius: var(--btn-r, 10px); background: var(--msg-surface-2); color: var(--msg-text) !important; font-size: var(--mp-fs, 14px); text-decoration: none; border: 1px solid transparent; }
  .mp-chip.on { background: var(--msg-accent); color: var(--msg-on-accent) !important; }
  .mp-chip img, .mp-chip svg { width: 20px; height: 20px; flex: none; }
  .mp-flat { padding: 4px 0 10px; }
  .mp-flat .sections { padding: 14px 18px 6px; color: var(--msg-muted); font-size: 14px; font-weight: 700; }
  .mp-foot { position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: 12px; align-items: center; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); background: var(--msg-surface); border-top: 1px solid var(--msg-border); }
  .mp-clear { flex: none; min-height: 48px; padding: 0 16px; border: 0; background: none; color: var(--msg-link); font-size: 17px; font-weight: 700; cursor: pointer; }
  .mp-show { flex: 1; min-height: 48px; border: 0; border-radius: var(--btn-r, 10px); background: linear-gradient(135deg, var(--msg-accent), var(--msg-accent-2)); color: var(--msg-on-accent); font-size: 17px; font-weight: 700; cursor: pointer; }
  body.mp-open .appbar { display: none; } /* the install / alerts bar never sits over the panel's bottom bar */
}
/* the plain-list look of the panel (the older rows) */
@media (max-width: 899px) {
  .mp-flat .collection-item { display: flex; align-items: center; gap: 10px; min-height: calc(var(--mp-h, 36px) + 6px); padding: 4px 18px; color: var(--msg-text) !important; font-size: var(--mp-fs, 14px); text-decoration: none; }
  .mp-flat .collection-item .count { margin-left: auto; color: var(--msg-muted); float: none; }
  .mp-flat .collection-item.second-nv-active { background: var(--msg-hover); font-weight: 700; }
}

/* the strip's tabs as the first block of the panel, like "Sort by" on the big sites */
@media (max-width: 899px) {
  .mp-top { padding: 14px 18px 16px; border-bottom: 1px solid var(--msg-border); }
  .mp-top-h { margin: 0 0 10px; font-size: calc(var(--mp-fs, 14px) + 2px); font-weight: 700; }
  .mp-top .mp-chips { display: flex; flex-wrap: wrap; gap: 8px; }
}

/* Sort by (phone Categories panel) */
.mp-sort { flex: none; padding: 12px 18px; border-bottom: 1px solid var(--msg-border); background: var(--msg-bg); } /* a bar of its own above the scrolling choices: they slide under its line instead of touching the drop-down */
.mp-sort .bt-sort { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--msg-text); font-size: 15px; }
.mp-sort .bt-sort-s { flex: 1; max-width: 220px; min-height: var(--btn-h, 36px); padding: 0 28px 0 12px; border: 1px solid var(--msg-border); border-radius: var(--btn-r, 8px); background: var(--msg-surface); color: var(--msg-text); font: inherit; font-size: 16px; }
