/* Homepage and book checkout only. Loaded last so touch layouts stay consistent. */
/* The spacing above the messages overlays the book on tablet/desktop. */
.hero-proof-pair { pointer-events: none; }
.hero-proof-pair > * { pointer-events: auto; }

@media (min-width: 761px) {
  .checkout-modal[open],
  .book-sample-modal[open] { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; }
  .checkout-modal #modal-content,
  .book-sample-modal #modal-content { grid-area: 1 / 1; min-width: 0; }
  .checkout-modal > .close,
  .book-sample-modal > .close {
    grid-area: 1 / 1;
    position: sticky;
    top: 8px;
    right: auto;
    align-self: start;
    justify-self: end;
    z-index: 10;
    width: 44px;
    height: 44px;
    margin: 8px 8px 0 0;
    padding: 0;
    border: 1px solid #d8d1bd;
    border-radius: 50%;
    background: #fffdf6;
    font-size: 30px;
    line-height: 1;
  }
  .checkout-modal .co-preview { min-height: 60px; display: flex; align-items: center; padding-right: 64px; }
}

/* Tablet reader cards use real rows so rotated cards cannot clip or overlap. */
@media (min-width: 601px) and (max-width: 800px) {
  .hero-book-showcase { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding-top: 420px; align-items: start; }
  .hero-book-showcase .hero-reader { position: relative; inset: auto; width: auto; min-width: 0; transform: none; }
  .hero-book-showcase .hero-reader-photo { height: auto; aspect-ratio: 1; }
  .hero-book-showcase .hero-reader blockquote { font-size: 12px; line-height: 1.5; }
  .hero-book-showcase .hero-reader .cv-static-link { min-height: 44px; font-size: 11px; }
  .hero-book-showcase .hero-proof-pair { grid-column: 1 / -1; padding-top: 0; }
}

@media (max-width: 760px) {
  .hero-book-first,
  .hero-book-first > *,
  .section-heading > *,
  .chapter-panel,
  .offer-copy { min-width: 0; }

  .vp-player { grid-template-columns: 44px minmax(32px, 1fr) 44px; gap: 4px 8px; }
  .vp-play,
  .vp-speed { min-width: 44px; min-height: 44px; touch-action: manipulation; }
  .vp-play { display: grid; place-items: center; }
  .vp-track { height: 44px; display: flex; align-items: center; }
  .vp-wave { width: 100%; }
  .vp-dot { top: 15px; }
  .vp-speed { font-size: 13px; }
  .ss-mode-toggle { min-height: 44px; touch-action: manipulation; }

  .footer-links { gap: 4px 20px; flex-wrap: wrap; }
  .footer-links a,
  .legal-row a,
  .legal-row button { display: inline-flex; align-items: center; min-height: 44px; font-size: 12px; }
  .legal-row > div { gap: 0 16px; }
  .site-footer { padding-bottom: calc(112px + env(safe-area-inset-bottom, 0px)); }

  /* Keep the order context and guarantee visible without burying the form. */
  .checkout-modal .co-summary { gap: 10px 12px; padding: 14px 16px; }
  .checkout-modal .co-book img { width: 38px; }
  .checkout-modal .co-book { gap: 10px; }
  .checkout-modal .co-book h3 { font-size: 13px; }
  .checkout-modal .co-book span { font-size: 11px; }
  .checkout-modal .co-total strong { font-size: 21px; }
  .checkout-modal .co-delivery { margin: 0; gap: 6px 16px; }
  .checkout-modal .co-delivery li > span { width: 18px; height: 18px; font-size: 13px; }
  .checkout-modal .co-delivery b { font-size: 11px; }
  .checkout-modal .co-top-stamp {
    grid-column: 1 / -1;
    grid-row: 3;
    justify-self: start;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px 7px;
    width: auto;
    max-width: 100%;
    min-height: 0;
    margin: 0;
    padding: 7px 10px;
    border-width: 2px;
    outline: 0;
    border-radius: 5px;
    transform: none;
  }
  .checkout-modal .co-top-stamp > span,
  .checkout-modal .co-top-stamp > b { font-size: 12px; line-height: 1.35; }
  .checkout-modal .co-top-stamp > small { width: 100%; font-size: 10px; line-height: 1.35; }
  .checkout-modal .co-reader-results { display: none; }
  .checkout-modal .co-main { padding-top: 16px; }
  .checkout-modal .co-steps { margin-bottom: 16px; }
  .checkout-modal .co-steps button { min-height: 52px; }
  .checkout-modal .co-intro { margin-bottom: 18px; }
  .checkout-modal .co-purchase-terms,
  .checkout-modal .co-legal-seller,
  .checkout-modal .co-privacy-notice { font-size: 12px; line-height: 1.65; }
  .checkout-modal .co-bottom-guarantee { flex-wrap: wrap; justify-content: center; gap: 16px; }
  .checkout-modal .co-bottom-guarantee p { flex: 1 1 170px; min-width: 0; font-size: 12px; line-height: 1.65; }
  .checkout-modal .co-bottom-guarantee p b { font-size: 13px; }
  .checkout-modal :is(input, select, button, a) { scroll-margin-block: 70px 24px; }
}

@media (max-width: 360px) {
  .checkout-modal .co-heading { font-size: 29px; }
  .vp-card { padding: 18px; }
  .vp-player { gap: 4px 6px; padding-inline: 8px; }
}
