/* Tablet and desktop layouts. Loaded last so these rules win over the max-height
   rules in styles.css and wall-editor.css, which also match short laptop windows.
   Phones (<640px) use none of this. Never centre an animated element with transform:
   wdIn, wdSheet and wdToast end at transform:none. */

/* Tablet: the phone layout in a centred column, without any device mockup. */
@media (min-width:640px){
  body{background:var(--beige-100)}
  #app{width:min(100%,520px);margin-inline:auto;box-shadow:0 0 0 1px rgba(0,0,0,.06),0 20px 60px rgba(40,30,24,.08);
    --top:max(24px,calc(env(safe-area-inset-top) + 12px));--bottom:max(24px,calc(env(safe-area-inset-bottom) + 12px))}
}

@media (min-width:1024px){
  #app{width:auto;box-shadow:none;--top:24px;--bottom:24px}
  /* Screens without a desktop design stay in a column. */
  #app:has(> .screen.col){width:min(100%,560px);box-shadow:0 0 0 1px rgba(0,0,0,.06)}
  .wd-toast{left:0;right:0;margin-inline:auto;width:min(480px,calc(100% - 40px));bottom:40px!important}

  /* Home: a lean two-column page like places.mixtiles.com. The mobile hero is hidden;
     the framed sample wall sits on the left, intro, steps and FAQ on the right. */
  .home-screen{background:var(--cream-50)!important}
  .home-screen{--header-h:64px}
  .home-product{font-size:18px}
  .home-logo{width:108px}
  .home-by{font-size:14px}
  .home-header .icon-btn{right:24px;bottom:12px}
  .home-hero{display:none}
  .home-more{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.15fr);gap:72px;align-items:start;max-width:1280px;margin:0 auto;padding:40px 48px 120px;background:transparent}
  .home-faq-visual{display:block;position:sticky;top:40px;aspect-ratio:5/6;max-height:calc(100vh - 140px);overflow:hidden;border-radius:16px;background:var(--beige-200)}
  .home-faq-room{position:absolute;width:180%;aspect-ratio:3/2;left:-41%;top:0}
  .home-intro{display:block;margin-bottom:64px}
  .home-intro h1{margin:0;font-size:44px;line-height:1.08;letter-spacing:-.025em;font-weight:700}
  .home-intro>p{margin:16px 0 0;font-size:18px;line-height:1.5;color:var(--brown-700)}
  .home-intro .cta{margin-top:32px;border-radius:12px}
  .home-dropzone{display:flex;flex-direction:column;align-items:center;gap:6px;width:100%;margin-top:14px;padding:28px 20px;border:2px dashed var(--beige-300);border-radius:16px;background:#fff;font-family:inherit;color:var(--brown-900);cursor:pointer;transition:border-color .15s,background .15s}
  .home-dropzone:hover,.home-dropzone.active{border-color:var(--rose-400);background:var(--rose-50)}
  .home-dropzone-emoji{font-size:34px;line-height:1;transition:transform .2s var(--ease-out)}
  .home-dropzone.active .home-dropzone-emoji{transform:translateY(4px) scale(1.15)}
  .home-dropzone strong{font-size:16px;font-weight:600}
  .home-dropzone>span:last-child{font-size:13px;color:var(--brown-500)}
  /* The box itself shows the drop state on the desktop home. */
  .home-screen .drop-overlay{display:none}
  .home-faq>h2{margin:56px 0 20px;font-size:28px;line-height:1.2;letter-spacing:-.02em;font-weight:700}
  .home-faq>h2{margin-top:0}
  .home-faq summary{font-size:22px;padding:26px 12px}
  .home-faq summary:hover{background:var(--beige-100)}
  .home-faq details p{font-size:16px;margin-bottom:28px}

  /* Picker: more columns, centred footer. */
  .picker-screen{padding-inline:max(24px,calc((100% - 1200px)/2))}
  .picker-grid{grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:8px}
  .picker-footer{padding-inline:max(20px,calc((100% - 480px)/2))}

  /* Room picker: one row. */
  .wall-screen{padding-inline:max(24px,calc((100% - 1100px)/2))}
  .wall-grid{grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:16px}

  /* Feed: wall on the left, details on the right. Cards page left/right at full width (no peek: the arrows sit at
     the sides of the wall). */
  .feed-track{padding-right:0;gap:0}
  .feed-screen{flex-direction:row;align-items:center}
  .feed-stage{align-self:stretch}
  .feed-panel .gallery-feed-actions{margin:0 56px 12px 24px}
  .gallery-feed-item{flex-direction:row;align-items:center}
  .gallery-feed-visual{align-self:stretch;margin:calc(var(--top) + 56px) 0 24px 24px;border-radius:16px;overflow:hidden}
  .gallery-feed-visual>.gallery-viewport{bottom:0}
  .gallery-feed-info{width:400px;flex:none;margin:0 56px 0 24px}
  .gallery-feed-info .cta{padding:15px 32px}
  .gallery-feed-rooms{width:400px;margin:14px 56px 0 24px;justify-content:flex-start}
  .feed-topbar{right:480px}
  .feed-dots{bottom:16px}
  .feed-nav{display:flex;justify-content:space-between;position:absolute;left:36px;right:492px;top:50%;margin-top:-20px;pointer-events:none}
  .feed-nav .icon-btn{pointer-events:auto}
  .feed-nav .icon-btn:disabled{opacity:.4;cursor:default}

  /* Detail: wall on the left, card and bag bar in a right column. */
  .detail-scroll.room{display:grid;grid-template-columns:minmax(0,1fr) 420px;overflow:hidden;padding-bottom:0}
  .gallery-detail-visual{height:auto;max-height:none;min-height:0;margin:calc(var(--top) + 56px) 24px 24px;border-radius:16px}
  .gallery-detail-visual>.gallery-viewport{bottom:0}
  .detail-card{margin-top:0;min-height:0;border-radius:0;overflow-y:auto;padding:calc(var(--top) + 64px) 28px 140px;box-shadow:-4px 0 20px rgba(0,0,0,.06)}
  .detail-bar{left:auto;width:420px}
  .detail-scroll.plan{padding-inline:max(0px,calc((100% - 760px)/2))}

  /* Editor: wall on the left, the sheet becomes a right side panel. */
  .we-screen{flex-direction:row}
  .we-stage{margin:calc(var(--top) + 56px) 24px 24px}
  .we-header{right:436px}
  .we-sheet{width:420px;max-height:none;height:100%;border-radius:0;padding:calc(var(--top) + 8px) 24px 24px;box-shadow:-12px 0 32px rgba(40,30,24,.12)}
  .we-handle{display:none}
  .we-above{left:auto;right:calc(100% + 24px);bottom:24px;margin:0;width:max-content}
  .we-tab-content{max-height:none;flex:1;min-height:0}
  .we-order{margin-top:auto}
  .we-crop-frame{width:min(100%,480px,calc(100cqh * var(--crop-ratio)))}
}
