/* Phone Review & Publish — designed as a phone screen (A1–A6).
   Loaded after review-publish-layout.css. Desktop two-panel stays in the
   layout sheet. This file owns the 768px phone rebuild. */

.rp-phone-switch { display: none; }
.rp-desk-thumb-label { display: none; }
.rp-desk-full { display: none; }

/* Reserved EXAMPLE PREVIEW strip — in-flow, never painted over search. */
.ql-preview-example-bar {
  display: none;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 36px;
  padding: 8px;
  box-sizing: border-box;
  position: relative;
  z-index: 2;
  width: 100%;
  background: #fff;
}
.ql-preview-frost-wrap.is-peeking > .ql-preview-example-bar {
  display: flex;
}
.ql-preview-frost-wrap.is-peeking > .ql-preview-example-bar .ql-preview-example-label {
  display: block !important;
  position: static;
  top: auto;
  left: auto;
  max-width: none;
  background: #111111 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  border: 1.5px solid #111111 !important;
}
.ql-preview-frost-wrap.is-peeking > .ql-preview-example-bar .ql-preview-example-dismiss {
  display: flex !important;
  position: static;
  top: auto;
  right: auto;
}

@media (max-width: 768px) {
  #page-create-quick-review,
  #page-create-wtb-review {
    --mobile-bottom-nav-h: 64px;
  }

  /* A4 — title only in the header. Publish lives once, at the bottom.
     Header Edit/Publish buttons are removed from the review HTML; this
     hide stays so a reintroduced pair cannot become a second primary. */
  #page-create-quick-review .wizard-header-mobile > .btn,
  #page-create-wtb-review .wizard-header-mobile > .btn {
    display: none !important;
  }
  #page-create-quick-review .wizard-header-mobile,
  #page-create-wtb-review .wizard-header-mobile {
    justify-content: center;
    gap: 0;
  }
  #page-create-quick-review .wizard-header-mobile > div,
  #page-create-wtb-review .wizard-header-mobile > div {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  /* A2 — Destinations | Preview. One surface at rest. */
  .rp-phone-switch {
    display: flex;
    gap: 4px;
    padding: 4px;
    margin: 0 0 16px;
    background: var(--bg-void);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
  }
  .rp-phone-switch-btn {
    flex: 1 1 0;
    min-height: 44px;
    min-width: 0;
    padding: 8px 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--off-white);
    font: inherit;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    cursor: pointer;
  }
  .rp-phone-switch-btn.is-active {
    background: var(--bg-panel);
    color: var(--white);
    box-shadow: 0 0 0 1.5px var(--border);
  }

  #page-create-quick-review > .page-content,
  #page-create-wtb-review > .page-content {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    height: auto;
    max-height: none;
    min-height: calc(100svh - var(--topbar-h, 44px) - var(--mobile-bottom-nav-h, 64px));
    padding: 8px 16px calc(8px + var(--mobile-bottom-nav-h, 64px) + env(safe-area-inset-bottom, 0px));
    overflow-x: hidden;
    overflow-y: auto;
  }
  #ql-review-content,
  #wtb-review-content {
    flex: 0 0 auto;
    min-height: auto;
    min-width: 0;
    max-width: 100%;
    padding-bottom: 16px;
    overflow-x: hidden;
    overflow-y: visible;
  }
  #page-create-quick-review .wtb-review-grid,
  #page-create-wtb-review .wtb-review-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
    max-width: 100%;
  }
  .wtb-review-grid[data-rp-pane="dests"] .wtb-review-right,
  .wtb-review-grid[data-rp-pane="preview"] .wtb-review-left {
    display: none;
  }
  #page-create-quick-review .wtb-review-left,
  #page-create-wtb-review .wtb-review-left,
  #page-create-quick-review .wtb-review-right,
  #page-create-wtb-review .wtb-review-right {
    flex: 0 0 auto;
    min-height: auto;
    max-height: none;
    min-width: 0;
    max-width: 100%;
    overflow: visible;
  }
  #page-create-quick-review .ql-plat-previews.card,
  #page-create-wtb-review .ql-plat-previews.card {
    flex: 0 0 auto;
    min-height: auto;
    max-width: 100%;
    overflow: visible;
  }
  #page-create-quick-review .inv-wiz-bottom,
  #page-create-wtb-review .inv-wiz-bottom {
    flex: 0 0 auto;
    margin-top: 16px;
    margin-bottom: 0;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)) !important;
    position: relative;
    z-index: 2;
    justify-content: stretch;
    gap: 8px;
  }
  #page-create-quick-review .inv-wiz-bottom .btn-gold,
  #page-create-wtb-review .inv-wiz-bottom .btn-gold {
    flex: 1 1 auto;
    min-height: 44px;
  }
  #page-create-quick-review .inv-wiz-bottom .btn-ghost,
  #page-create-wtb-review .inv-wiz-bottom .btn-ghost {
    flex: 0 0 auto;
    min-height: 44px;
  }

  /* Platform tabs: one row, internal scroll with a visible bar. Page does
     not scroll sideways. Tabs size to their label — never flex:1 squeeze
     (that clipped "Shopify" to "hopify" at 390px). */
  .ql-plat-previews,
  .ql-plat-previews.card {
    min-width: 0;
    max-width: 100%;
  }
  .ql-plat-preview-tabs,
  html[data-remodel="2"] .ql-plat-preview-tabs {
    display: flex;
    flex-wrap: nowrap;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--gold, #8b7355) var(--bg-void, transparent);
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    justify-content: flex-start;
    /* No inset fade — a fade on a mid-strip tab reads as "Insta…". */
    box-shadow: none;
  }
  .ql-plat-preview-tabs::-webkit-scrollbar,
  html[data-remodel="2"] .ql-plat-preview-tabs::-webkit-scrollbar {
    height: 6px;
    display: block;
  }
  .ql-plat-preview-tabs::-webkit-scrollbar-thumb {
    background: var(--gold, #8b7355);
    border-radius: 99px;
  }
  /* Phone Preview strip (A6 / tip 87213): icon + aria-label only.
     Three full words (WhatsApp · Telegram · Instagram) do not fit 390px
     at rest — PR 737's max-content + scroll still painted "Insta…". */
  .ql-plat-preview-tab,
  html[data-remodel="2"] .ql-plat-preview-tab {
    flex: 0 0 44px !important;
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip !important;
    min-width: 44px;
    width: 44px;
    max-width: 44px;
    min-height: 44px;
    height: 44px;
    padding: 0;
    font-size: 0 !important;
    line-height: 0;
    justify-content: center;
    box-sizing: border-box;
  }
  .ql-plat-preview-tab,
  .ql-plat-preview-tab *,
  html[data-remodel="2"] .ql-plat-preview-tab,
  html[data-remodel="2"] .ql-plat-preview-tab * {
    text-overflow: clip !important;
  }
  .ql-plat-preview-tab-label {
    display: none !important;
  }
  .ql-plat-preview-tab .ql-plat-mark {
    margin-right: 0;
    width: 22px;
    height: 22px;
  }
  .ql-plat-preview-tab svg,
  .ql-plat-preview-tab img,
  .ql-plat-preview-tab .ql-plat-mark img {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
  }

  .ql-plat-previews.card,
  .ql-device-stage {
    overflow: visible;
    max-width: 100%;
  }

  /* A3 sharpened (Hal 2026-09-07) — real Apple iPhone bezel on phone Preview.
     Desktop-on-phone stays the flat labeled thumbnail below. */
  .ql-device-stage[data-device="mobile"] {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 0;
    height: auto;
    max-height: none;
    padding: 8px 8px 24px;
    box-sizing: border-box;
  }
  .ql-device-stage[data-device="mobile"] .ql-device {
    --rp-preview-fit: min(360px, max(280px, calc(100svh - 480px)));
    height: var(--rp-preview-fit);
    min-height: 280px;
    max-height: var(--rp-preview-fit);
    width: calc(var(--rp-preview-fit) * 1350 / 2760);
    max-width: min(320px, 100%);
    box-sizing: border-box;
    aspect-ratio: 1350 / 2760;
    background-image: url('/device-frames/iPhone-16-Pro-Black-Titanium-Portrait.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
    box-shadow: 0 16px 32px -12px rgba(0, 0, 0, 0.45);
    border: none;
    border-radius: 0;
    overflow: visible;
    position: relative;
  }
  .ql-device-stage[data-device="mobile"] .ql-device-screen {
    position: absolute;
    left: 5.333%;
    top: 7.971%;
    width: 89.333%;
    height: 89.529%;
    max-height: 89.529%;
    min-height: 0;
    overflow: hidden;
  }

  /* A3 — never a laptop mockup on a phone. Flat labeled thumbnail. */
  .ql-device-stage[data-device="desktop"] {
    --rp-desk-h: min(360px, max(280px, calc(100svh - 480px)));
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
    height: auto;
    max-height: none;
    padding: 8px;
    box-sizing: border-box;
    overflow: visible;
  }
  .ql-device-stage[data-device="desktop"] .ql-device {
    background-image: none !important;
    aspect-ratio: auto;
    width: 100%;
    max-width: 100%;
    height: var(--rp-desk-h);
    min-height: 280px;
    max-height: 360px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
  }
  .ql-device-stage[data-device="desktop"] .ql-device-screen {
    position: relative;
    left: auto;
    top: auto;
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: 100%;
  }
  .ql-device-stage[data-device="desktop"] .pp-browse-grid,
  .ql-device-stage[data-device="desktop"] .c24-grid,
  .ql-device-stage[data-device="desktop"] .pp-grid2 {
    grid-template-columns: 1fr 1fr;
  }
  .ql-device-stage[data-device="mobile"] .rp-desk-thumb-label {
    display: none;
  }
  /* Telegram scale host: definite glass so 100cqh is real (not auto → 0). */
  .ql-device-stage[data-device="desktop"] .tg-preview-scale {
    min-height: 0;
    height: 100%;
    max-height: 100%;
  }
  /* Phone×Desktop thumb is a tall portrait glass (~140×360). Scaling the
     1512×982 Mac canvas into it letterboxes a postage stamp. Use the
     portrait artifact canvas, keep the 296px desktop PHOTO, and keep a
     compact sidebar (Desktop toggle = sidebar; never hide it). */
  .ql-device-stage[data-device="desktop"] .ql-device-screen .tg-preview-scale .tg-preview-wrap {
    --tg-logical-w: 402px;
    --tg-logical-h: 874px;
  }
  .ql-device-stage[data-device="desktop"] .ql-device-screen .tg-preview-sidebar {
    display: flex;
    flex-direction: column;
    flex: 0 0 88px;
    flex-basis: 88px;
    width: 88px;
    min-width: 88px;
    max-width: 88px;
  }
  .ql-device-stage[data-device="desktop"] .ql-device-screen .tg-side-search {
    margin: 8px 6px 4px;
    padding: 6px 8px;
    font-size: 11px;
    line-height: 14px;
  }
  .ql-device-stage[data-device="desktop"] .ql-device-screen .tg-side-row {
    padding: 8px 6px;
    gap: 6px;
    min-height: 52px;
  }
  .ql-device-stage[data-device="desktop"] .ql-device-screen .tg-side-av {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    font-size: 11px;
  }
  .ql-device-stage[data-device="desktop"] .ql-device-screen .tg-side-time {
    display: none;
  }

  /* Rule 30 — do not crush .ph. The layout sheet scales the 402×874 /
     1512×982 canvas into this glass. Island clearance is on the SCALE
     host (glass pixels), not a shorter PHOTO tile. Padding shrinks
     100cqh; top:22px moves the canvas into that content box (absolute
     children pin to the padding edge, so padding alone is not enough). */
  .ql-device-stage[data-device="mobile"] .ql-device-screen .tg-preview-scale {
    padding-top: 22px;
    box-sizing: border-box;
  }
  .ql-device-stage[data-device="mobile"] .ql-device-screen .tg-preview-scale .tg-preview-wrap {
    top: 22px;
  }

  /* A6 — header name + subtitle must read in full (never Wa / Cha). */
  .ql-device-stage .ql-device-screen .tg-preview-wrap .tg-preview-head-text {
    flex: 1 1 auto;
    min-width: 0;
  }
  .ql-device-stage .ql-device-screen .tg-preview-wrap .preview-wa-name,
  .ql-device-stage .ql-device-screen .tg-preview-wrap .preview-wa-sub,
  .ql-plat-previews .ql-device-screen .tg-preview-wrap .preview-wa-name,
  .ql-plat-previews .ql-device-screen .tg-preview-wrap .preview-wa-sub {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    word-break: normal;
    overflow-wrap: break-word;
  }
  .ql-device-stage[data-device="desktop"] .ql-device-screen .tg-side-body b {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  .ql-device-stage[data-device="desktop"] .rp-desk-thumb-label {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    margin: 0 0 8px;
    padding: 8px 12px;
    width: 100%;
    box-sizing: border-box;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: var(--bg-void);
    color: var(--white);
    font: inherit;
    font-size: 16px;
    font-weight: 600;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    cursor: pointer;
  }
}

.rp-desk-full {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 400;
  background: var(--bg-void);
  flex-direction: column;
}
.rp-desk-full.is-open { display: flex; }
.rp-desk-full-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 52px;
  padding: 8px 16px;
  border-bottom: 1.5px solid var(--border);
  font-size: 16px;
  font-weight: 600;
}
.rp-desk-full-close {
  min-height: 44px;
  min-width: 44px;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--bg-panel);
  color: var(--white);
  font: inherit;
  font-size: 16px;
  cursor: pointer;
}
.rp-desk-full-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 16px;
}
body.rp-desk-full-open { overflow: hidden; }
