/* ============================================================
   Desktop preview: phone frame wrapper
   ============================================================ */

/* Only show phone frame on wide screens */
@media (min-width: 768px) {
  /* Force body to center the phone */
  body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #E4E4E7;
    padding: 24px 16px;
  }

  /* Phone chassis */
  .phone-frame {
    position: relative;
    width: 375px;
    height: calc(100vh - 48px);
    max-height: 812px;
    background: var(--bg-page);
    border-radius: 36px;
    box-shadow:
      0 0 0 3px #1A1A1A,
      0 0 0 6px #3A3A3C,
      0 12px 40px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    flex-shrink: 0;
  }

  /* Dynamic notch / camera */
  .phone-frame::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 28px;
    background: #1A1A1A;
    border-radius: 0 0 18px 18px;
    z-index: 200;
    pointer-events: none;
  }

  /* Right side volume buttons */
  .phone-frame::after {
    content: '';
    position: absolute;
    right: -3px;
    top: 160px;
    width: 4px;
    height: 64px;
    background: #3A3A3C;
    border-radius: 0 2px 2px 0;
    z-index: 200;
    pointer-events: none;
  }

  /* Left side power button */
  .phone-side-btn {
    position: absolute;
    left: -3px;
    top: 200px;
    width: 4px;
    height: 40px;
    background: #3A3A3C;
    border-radius: 2px 0 0 2px;
    z-index: 200;
    pointer-events: none;
  }

  /* Header area pushed down for notch */
  .header {
    padding-top: 28px !important;
  }

  /* Tab bar fixed to phone bottom */
  .tab-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
  }

  /* Home indicator */
  .phone-frame .home-indicator {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 134px;
    height: 5px;
    background: #1A1A1A;
    border-radius: 3px;
    opacity: 0.2;
    z-index: 200;
    pointer-events: none;
  }

/* Chat input fixed at bottom (qa.html) */
  .chat-input-fixed,
  div[style*="position:fixed"] {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
  }

  /* Active page fills remaining space above tab bar */
  .page.active {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 56px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Page content scroll area */
  .page-content {
    height: 100%;
    padding-bottom: 0;
  }

  /* Pages that use full-screen layout */
  .page.full-screen {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    bottom: 56px;
  }
}

/* Mobile: no frame, full width */
@media (max-width: 767px) {
  .phone-frame {
    width: 100%;
    height: 100vh;
    border-radius: 0;
    box-shadow: none;
  }
  .phone-frame::before,
  .phone-frame::after,
  .phone-side-btn,
  .phone-frame .home-indicator {
    display: none;
  }
}
