/* mainstay order-fix v1 (2026-10-28, round 2 2026-10-30), phone widths only (below 860px). Layout only: no string lives here, no price, pack, timer logic or payment rule changes.
 * From the 10-27 session read: nobody reached a field, and on two of three layouts the first field sat below the first screen.
 *   1. The reserved wallet place no longer holds blank space. Until a wallet button is live the section is laid out (so the wallet frame still mounts) but takes
 *      no room, exactly as the page already does while the wallet verdict is unknown.
 *   2. The reserved-price clock stays in its original place above the first field, but takes no room while it is hidden (the page's reserved invisible box is
 *      released); it shows in place, unchanged, as soon as the server hold exists. The stock line stays where it is.
 *   3. The product / summary block is compacted (smaller picture, tighter rows); bonuses stay, on one line.
 *   4. Summary rows are plain text; only the summary toggle looks like a control.
 *   5. The reassurance block (guarantee + two reviews, mounted by mainstay-order-fix-v1.js) sits between Shipping and Payment (round 2: it used to sit
 *      under Contact, where on a slow phone it painted late as the largest text of the first screen and became the page's LCP).
 * Round 2 (ORD-R2, 2026-10-30): form first. On a phone the first screen is one compact strip (order summary line with the total, the reserve clock line
 * with its space reserved from the first paint, the stock line) and then CONTACT INFORMATION + First name. The summary is collapsed at the first paint on
 * every layout (it used to render open and collapse a moment later). Strings are the page's own; nothing is written here. */
@media (max-width: 859px) {
  /* 1 */
  body.dr-page .dr-express[data-dr-express-probe][data-dr-express-reserve]:not([data-dr-express-live]) {
    position: absolute; left: 0; right: 0; height: 56px; margin: 0; overflow: visible; opacity: 0; pointer-events: none; z-index: -1;
  }

  /* 2 (round 2): the reserve clock keeps its (now compact) box from the first paint; see the strip rules below. */

  /* 3 */
  body.dr-page .dr-checkout:not([data-dr-stage="upsell"]):not([data-dr-stage="thank_you"]) .dr-form { gap: 14px; }
  body.dr-page .dr-skin-summary { gap: 10px; }
  body.dr-page .dr-skin-summary__thumb { flex-basis: 48px; width: 48px; height: 48px; }
  body.dr-page .dr-summary__row { padding: 2px 0; }
  body.dr-page .dr-summary__row--total { margin-top: 4px; padding-top: 6px; }
  body.dr-page .dr-summary[data-dr-collapsible][data-dr-collapse-ready] .dr-summary__toggle { padding: 8px 12px; }
  body.dr-page .dr-summary[data-dr-collapsible][data-dr-collapse-ready][data-dr-expanded] > .dr-skin-summary { margin-top: 6px; }
  body.dr-page[data-dr-handoff-form-first][data-dr-pack-locked] .dr-locked { margin-top: 6px; }
  body.dr-page .dr-trust-row__list { gap: 4px 10px; }
  body[data-ms-order-layout] .ms-fs:not([hidden]) { padding: 8px 10px; }
  body[data-ms-order-layout] .ms-fs__row { gap: 10px; }
  body[data-ms-order-layout] .ms-fs__media img { width: 56px; height: 56px; }
  body[data-ms-order-layout] .ms-fs__name { font-size: 1rem; }
  body[data-ms-order-layout] .ms-fs__contents { font-size: 0.8125rem; }
  body[data-ms-order-layout] .ms-fs__price { margin-top: 2px !important; }
  body[data-ms-order-layout] .ms-fs__unit { font-size: 1.25rem; }
  body[data-ms-order-layout] .ms-fs__chips, body[data-ms-order-layout] .ms-fs__bonuses { margin-top: 6px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  body[data-ms-order-layout] .ms-fs__chips::-webkit-scrollbar, body[data-ms-order-layout] .ms-fs__bonuses::-webkit-scrollbar { display: none; }
  body[data-ms-order-layout] .ms-fs__chip, body[data-ms-order-layout] .ms-fs__bonus { flex: 0 0 auto; white-space: nowrap; }
  body[data-ms-order-layout] .ms-fs__guarantee { margin-top: 6px; gap: 8px; font-size: 0.875rem; }
  body[data-ms-order-layout] .ms-fs__seal svg { width: 34px; height: 34px; }

  /* ---- round 2: form first ---------------------------------------------------------------------------------------------------------------- */
  /* strip order: product row (first-screen layout only), summary line, clock line, stock line, then the wallet (when live) and the form */
  body.dr-page[data-dr-cart-skin] .dr-form { gap: 12px; }
  body.dr-page[data-dr-cart-skin] .dr-form .ms-fs { order: -40 !important; }
  body.dr-page[data-dr-cart-skin] .dr-form .dr-summary { order: -30 !important; }
  body.dr-page[data-dr-cart-skin] .dr-form .dr-reserved { order: -20 !important; }
  body.dr-page[data-dr-cart-skin] .dr-form .dr-scarcity { order: -10 !important; }
  /* the trust row (checks + stars) joins the other reassurance text at the bottom on every layout */
  body.dr-page[data-dr-cart-skin] .dr-form .dr-trust-row { order: 13 !important; margin: 0; }

  /* summary line: collapsed at the first paint (before the runtime wires the toggle), one tap opens it. Until the runtime wired the toggle it is not tappable. */
  body.dr-page:not([data-ms-v2-failed]) .dr-summary[data-dr-collapsible] > .dr-section__heading { display: none; }
  body.dr-page:not([data-ms-v2-failed]) .dr-summary[data-dr-collapsible]:not([data-dr-expanded]) > :not(.dr-summary__toggle) { display: none !important; }
  body.dr-page:not([data-ms-v2-failed]) .dr-summary[data-dr-collapsible] .dr-summary__toggle { display: flex; align-items: center; gap: 6px; width: 100%; margin: 0; min-height: 40px; padding: 8px 12px; font: 700 0.9375rem/1.2 var(--dr-font); color: var(--dr-ink); text-align: left; background: #fff; border: 1px solid var(--dr-line); border-radius: 6px; cursor: pointer; }
  body.dr-page .dr-summary[data-dr-collapsible]:not([data-dr-collapse-ready]) .dr-summary__toggle { pointer-events: none; }
  body.dr-page .dr-summary__toggle-caret { display: inline-block; color: var(--dr-accent); transition: transform 0.15s; }
  body.dr-page .dr-summary[data-dr-expanded] .dr-summary__toggle-caret { transform: rotate(90deg); }
 body.dr-page .dr-summary__toggle-total { margin-left: auto; font-weight: 800; }
  /* the total on the compact line shows only once it is synced to the real summary (this script or the v2 runtime), never the markup's default pack total */
  body.dr-page:not([data-ms-total-ready]) .dr-summary[data-dr-collapsible]:not([data-dr-collapse-ready]) .dr-summary__toggle-total { visibility: hidden; }
  body.dr-page .dr-summary[data-dr-collapsible][data-dr-expanded] > .dr-skin-summary { margin-top: 6px; }
  /* the store skin styles its summary as a padded panel with a bare toggle (more specific than anything above): same compact bordered line as the reserve page */
  body.dr-page .dr-store-summary { padding: 0 !important; background: transparent !important; border: 0 !important; }
  body.dr-page .dr-store-summary .dr-summary__toggle { min-height: 40px !important; padding: 8px 12px !important; background: #fff !important; border: 1px solid var(--dr-line) !important; border-radius: 6px !important; }
  /* the pills in the open summary are plain facts, not buttons */
  body.dr-page .dr-pack__pill, body.dr-page .ms-fs__chip, body.dr-page .ms-fs__bonus { cursor: default; -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; pointer-events: none; }
  body.dr-page .dr-pack__pill--bonus { background: transparent; border-color: transparent; padding-left: 0; padding-right: 0; }

  /* clock line: one compact line whose box exists from the first paint (hidden = invisible, not removed), so the hold landing moves nothing */
  body.dr-page[data-dr-cart-skin] .dr-checkout:not([data-dr-stage="upsell"]):not([data-dr-stage="thank_you"]):not([data-dr-stage="confirming"]):not([data-dr-stage="confirmation"]) .dr-form .dr-reserved { display: flex; align-items: center; justify-content: center; gap: 4px; box-sizing: border-box; height: 34px; margin: 0; padding: 0 6px; overflow: hidden; white-space: nowrap; font-size: 0.75rem !important; letter-spacing: -0.01em; font-weight: 700; line-height: 1.2; background: #fff8db; border: 1px solid #f2c230; border-radius: 6px; }
  body.dr-page[data-dr-cart-skin] .dr-checkout:not([data-dr-stage="upsell"]):not([data-dr-stage="thank_you"]):not([data-dr-stage="confirming"]):not([data-dr-stage="confirmation"]) .dr-form .dr-reserved[hidden] { display: flex !important; visibility: hidden; }
  body.dr-page[data-dr-cart-skin] .dr-form .dr-reserved .dr-reserved__clock { display: inline-block; min-width: 3em; margin: 0; font-size: 1rem !important; line-height: 1.2; text-align: left; }

  /* stock line: two short lines at most */
  body.dr-page[data-dr-cart-skin] .dr-form .dr-scarcity { margin: 0; padding: 6px 10px; font-size: 0.8125rem; line-height: 1.25; text-wrap: balance; }
  body.dr-page .dr-form .dr-summary, body.dr-page .dr-form .dr-reserved, body.dr-page .dr-form .dr-scarcity { margin-bottom: -4px; }
  body.dr-page .dr-form .dr-scarcity { margin-bottom: 0; }

  /* first-screen layout: the product block is one row (picture, name, total); chips, bonuses and the guarantee line leave the first screen (the summary line stays: it carries Change) */
  body.dr-page[data-ms-order-layout] .ms-fs:not([hidden]) { padding: 6px 10px; margin-bottom: -4px; }
  body.dr-page[data-ms-order-layout] .ms-fs__media img { width: 40px; height: 40px; }
  body.dr-page[data-ms-order-layout] .ms-fs__contents, body.dr-page[data-ms-order-layout] .ms-fs__chips, body.dr-page[data-ms-order-layout] .ms-fs__bonuses, body.dr-page[data-ms-order-layout] .ms-fs__guarantee, body.dr-page[data-ms-order-layout] .ms-fs__anchor, body.dr-page[data-ms-order-layout] .ms-fs__unit { display: none; }
  body.dr-page[data-ms-order-layout] .ms-fs__name { font-size: 0.9375rem; }
  body.dr-page[data-ms-order-layout] .ms-fs__price { margin-top: 0 !important; }
  body.dr-page[data-ms-order-layout] .ms-fs__total { margin-top: 0 !important; font-size: 0.875rem; }

  /* the contact block: heading and first field right under the strip */
  body.dr-page .dr-fields { gap: 10px; }
  body.dr-page .dr-fields .dr-section__heading { margin: 0; }
  body.dr-page .dr-field { gap: 2px; }
  body.dr-page .dr-field--error input, body.dr-page .dr-field--error select { scroll-margin-top: 96px; }

  /* 4 */
  body.dr-page .dr-summary__row, body.dr-page .dr-summary__row *, body.dr-page .dr-skin-summary { cursor: default; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
  body.dr-page .dr-summary__toggle, body.dr-page .dr-summary__toggle * { cursor: pointer; }
}

/* 5 */
.ms-reassure { margin: 4px 0 8px; padding: 10px 12px; background: #f7f9fc; border: 1px solid var(--dr-line, #d9dee5); border-radius: 8px; }
.ms-reassure__guarantee { display: flex; align-items: center; gap: 10px; }
.ms-reassure__seal { flex: 0 0 auto; line-height: 0; }
.ms-reassure__seal svg { width: 44px; height: 44px; }
.ms-reassure__line { margin: 0; font-size: 0.875rem; font-weight: 700; line-height: 1.35; color: var(--dr-ink, #1a1a1a); }
.ms-reassure__reviews { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.ms-reassure__review { margin: 0; padding: 8px 10px; background: #fff; border: 1px solid var(--dr-line, #d9dee5); border-radius: 6px; font-size: 0.875rem; line-height: 1.35; }
.ms-reassure__review p { margin: 0; }
.ms-reassure__review .vsl-review__rating { color: #e8a200; letter-spacing: 1px; font-size: 0.9375rem; }
.ms-reassure__review .vsl-review__body { margin-top: 2px; }
.ms-reassure__review .vsl-review__meta { margin-top: 4px; font-size: 0.8125rem; color: #4b5563; }
.dr-checkout[data-dr-stage="confirming"] .ms-reassure,
.dr-checkout[data-dr-stage="upsell"] .ms-reassure,
.dr-checkout[data-dr-stage="thank_you"] .ms-reassure,
.dr-checkout[data-dr-stage="confirmation"] .ms-reassure,
.dr-checkout[data-dr-stage="fallback"] .ms-reassure { display: none; }
