/* Maqas guide chat + the phone layout. Loaded after app.css. */
:root { color-scheme: only light; }

/* ---------- guide: step tip ---------- */
.gtip { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 18px; max-width: 640px; }
#v-space .hero { margin-bottom: 18px; } #v-space .gtip { margin: 0 0 22px; }
.g-av { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; font: 700 14px var(--font-b); flex: none; }
.g-bub { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 4px 16px 16px 16px; padding: 10px 13px; font-size: 15px; line-height: 1.45; }
.g-bub b { font-weight: 600; }
.g-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.g-chip { min-height: 36px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line2); background: var(--card); font-size: 14px; font-weight: 500; color: var(--ink); }
.g-chip:first-child { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.g-chip:hover { border-color: var(--accent); }
.g-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.g-links a { display: inline-flex; align-items: center; min-height: 34px; padding: 0 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 14px; font-weight: 600; text-decoration: none; }

/* ---------- guide: floating button + chat panel ---------- */
.g-pill { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 40; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 16px 6px 6px; border: 0; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 600; font-size: 14px; box-shadow: 0 8px 24px rgba(26,26,24,.25); }
.g-pill .g-av { width: 30px; height: 30px; background: #fff; color: var(--accent); font-size: 13px; }
.g-back { position: fixed; inset: 0; z-index: 55; background: rgba(26,26,24,.35); }
.g-sheet { position: fixed; z-index: 60; display: flex; flex-direction: column; background: var(--card); box-shadow: 0 -10px 40px rgba(26,26,24,.18);
  left: 0; right: 0; bottom: 0; height: min(86dvh, 720px); border-radius: 22px 22px 0 0; padding-bottom: env(safe-area-inset-bottom); }
.g-grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line2); margin: 8px auto 2px; flex: none; }
.g-head { display: flex; align-items: center; gap: 10px; padding: 8px 16px 12px; border-bottom: 1px solid var(--line3); }
.g-head b { display: block; font-size: 15px; } .g-head .small { display: block; font-size: 12.5px; }
.g-head .g-av { width: 30px; height: 30px; }
.g-x { margin-left: auto; width: 40px; height: 40px; border: 0; background: none; font-size: 26px; line-height: 1; color: var(--muted); }
.g-log { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.g-row { display: flex; gap: 9px; align-items: flex-start; max-width: 92%; }
.g-row .g-av { width: 28px; height: 28px; font-size: 12px; }
.g-row .g-bub { font-size: 14.5px; }
.g-me { margin: 0 0 0 auto; max-width: 80%; background: var(--accent); color: #fff; border-radius: 16px 4px 16px 16px; padding: 10px 13px; font-size: 14.5px; line-height: 1.45; }
.g-done { margin: 6px 0 0; font-size: 13px; font-weight: 600; color: var(--accent); }
.g-typing { display: inline-flex; gap: 4px; padding: 14px; }
.g-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); animation: gdot 1.2s infinite ease-in-out; }
.g-typing i:nth-child(2) { animation-delay: .15s; } .g-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes gdot { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.g-form { display: flex; gap: 8px; align-items: center; padding: 10px 12px 12px; border-top: 1px solid var(--line3); }
.g-form input { flex: 1; min-width: 0; min-height: 46px; padding: 0 16px; border: 1px solid var(--line2); border-radius: 999px; font-size: 16px; background: var(--soft); }
.g-send { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex: none; }
body.g-open { overflow: hidden; }
@media (min-width: 900px) {
  .g-back { background: transparent; }
  .g-sheet { left: auto; right: 16px; bottom: 16px; width: 400px; height: min(640px, calc(100vh - 32px)); border-radius: 20px; border: 1px solid var(--line); }
  .g-grab { display: none; } .g-head { padding-top: 14px; }
  body.g-open { overflow: auto; }
}
@media (prefers-reduced-motion: reduce) { .g-typing i { animation: none; opacity: .6; } }

/* phone dock and sheet parts are hidden on bigger screens */
.m-dock, .m-grab, .m-lines { display: none; }

/* ---------- phone layout ---------- */
@media (max-width: 720px) {
  body { --dock: 0px; overflow-x: clip; }
  body[data-step="rooms"] { --dock: 84px; }
  body[data-step="renders"] { --dock: 132px; }
  .g-pill { bottom: calc(var(--dock) + 12px + env(safe-area-inset-bottom)); }

  /* header: logo plus a slim progress bar */
  .top-in { padding: 10px 16px; flex-wrap: nowrap; }
  .logo { font-size: 22px; }
  .steps { gap: 5px; flex-wrap: nowrap; }
  .stp, .stp.cur { padding: 0; width: 24px; height: 4px; min-height: 0; border-radius: 2px; background: var(--line2); }
  .stp.cur, .stp.done { background: var(--accent); }
  .stp .n, .stp .lbl, .stp.cur .lbl, .bar { display: none; }
  .stp { position: relative; } .stp::after { content: ""; position: absolute; inset: -14px -2px; }

  .view { padding: 18px 16px calc(var(--dock) + 88px); }
  #v-space { padding-top: 22px; }
  .eyebrow { display: none; }
  .h1 { font-size: 26px; }
  .headrow { margin-bottom: 12px; gap: 10px; }
  .gtip { margin-bottom: 14px; }
  .g-bub { font-size: 14.5px; }
  .foot { padding-bottom: calc(var(--dock) + 24px); font-size: 12px; }
  body[data-step="renders"] .foot, body[data-step="checkout"] .foot { display: none; }

  /* step 1: one card, no long scroll */
  .hero { margin-bottom: 16px; }
  .display { font-size: 32px; margin-bottom: 10px; }
  .lede { font-size: 16px; }
  .card.upload { padding: 12px; border-radius: 18px; }
  .card.upload.compact .drop { flex-direction: column; text-align: center; padding: 20px 16px; gap: 12px; }
  .card.upload.compact .drop .btn { width: 100%; }
  .reading { min-height: 0; gap: 16px; }
  .read-vis { min-height: 200px; } .read-thumb img, .read-thumb .pdf { height: 220px; }

  /* step 2: plan, list, button docked at the bottom */
  #v-rooms .card.upload { border: 0; background: none; padding: 0; }
  .rooms-ok { gap: 14px; }
  .rooms-vis, .rooms-side { flex-basis: 100%; }
  #aptplan { max-height: 300px; background: var(--card); border: 1px solid var(--line); }
  .ref2 { display: none; }
  .rooms-side > div:first-child { display: none; }
  .rooms-cta { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(rgba(245,243,239,0), var(--bg) 26%); }
  .rooms-cta .btn { width: 100%; }
  .plan-ok { gap: 14px; }

  /* step 3: full-width photo, compact styles, pieces in a sheet */
  #v-renders .headrow { flex-wrap: nowrap; align-items: center; margin-bottom: 8px; }
  #v-renders .h1 { font-size: 21px; }
  #v-renders .gtip { margin: 4px 0 0; }
  #v-space .gtip { margin: 16px 0 0; }
  #v-renders .tabs a { min-height: 34px; padding: 0 12px; font-size: 13px; }
  #v-renders .split { gap: 14px; }
  #shot-pane { margin: 0 -16px; padding: 0; border: 0; border-radius: 0; background: none; gap: 8px; }
  .shot-main { border-radius: 0; aspect-ratio: 4 / 3; }
  .shot-thumbs { display: flex; justify-content: center; gap: 8px; padding: 0 16px; }
  .thumb, .thumb[aria-pressed=true] { flex-direction: row; align-items: center; gap: 6px; padding: 3px 12px 3px 3px; border-radius: 999px; min-height: 40px; }
  .thumb img { width: 34px; height: 34px; aspect-ratio: 1; border-radius: 50%; }
  .thumb, .thumb[aria-pressed=true] { flex: 0 1 auto; min-width: 0; }
  .thumb .small { font-size: 12.5px; padding: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .thumb .spin.sm { width: 16px; height: 16px; top: 12px; left: 12px; }
  #shot-note { padding: 0 16px; font-size: 13px; }
  .roomtabs { margin: 0 -16px 4px; padding: 2px 16px 8px; }
  .rtab { min-height: 44px; padding: 6px 12px; } .rtab[aria-selected=true] { padding: 5px 11px; }
  #v-renders .sidecol { gap: 12px; }
  #v-renders .sidecol .minor { justify-content: center; }
  .shot-bar { padding: 0 16px; flex-direction: column; align-items: stretch; gap: 8px; min-width: 0; }
  .shot-thumbs { padding: 0; width: 100%; }
  .shot-thumbs .thumb { flex: 1 1 0; }
  .styles { flex-wrap: nowrap; width: 100%; }
  .styles .sty { flex: 1 1 0; min-width: 0; justify-content: center; }
  .sty b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #r-eyebrow { display: none; }
  .shot-main .hl span { font-size: 12px; }
  #cta-checkout { display: none; }
  #pieces-card { position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; max-height: var(--pc-max, calc(88dvh - var(--dock))); overflow-y: auto; overscroll-behavior: contain; border-radius: 22px 22px 0 0; border: 0; padding: 0 16px calc(var(--dock) + 16px); box-shadow: 0 -10px 40px rgba(26,26,24,.16); transform: translateY(105%); transition: transform .25s ease; visibility: hidden; }
  body.pieces-open #pieces-card { transform: none; visibility: visible; }
  body.pieces-open .g-pill { display: none; }
  body.pieces-short .shot-main { aspect-ratio: 16 / 9; }
  #pieces-card > .between { display: none; } /* the dock already says "Your pieces · 8 of 8" */
  .m-grab { display: block; width: 100%; height: 30px; border: 0; background: var(--card); position: sticky; top: 0; z-index: 1; margin-bottom: 4px; }
  .m-grab::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--line2); margin: 10px auto 0; }
  .m-dock { display: flex; flex-direction: column; gap: 10px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 36; background: var(--card); border-radius: 22px 22px 0 0; padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 30px rgba(26,26,24,.12); }
  body.pieces-open .m-dock { border-radius: 0; box-shadow: 0 -1px 0 var(--line); }
  #v-renders[hidden] .m-dock { display: none; }
  .m-sum { display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 0; background: none; padding: 0; text-align: left; width: 100%; }
  .m-sum > span:first-child { min-width: 0; } .m-tot { flex: none; }
  .m-sum b { display: block; font-size: 15px; } .m-sum .small { display: block; font-size: 12.5px; }
  .m-tot { text-align: right; } .m-tot b { font: 700 19px var(--font-d); font-variant-numeric: tabular-nums; }
  .m-cta { width: 100%; }

  /* step 4: photo, one WhatsApp button */
  .real { border-radius: 18px; }
  .real-body { padding: 18px 16px 20px; }
  #v-checkout .lede { font-size: 16px; }
}
