/* ==========================================================================
   Device frame - shows every screen inside a phone, like the GP app
   (gp-healthio.yiion.com): a true 430 x 880 device, scaled to fit the
   window. js/frame.js adds .is-framed to <html> and builds the shell; on a
   real phone (narrow screen) nothing here applies and the app is full-screen.
   ========================================================================== */

html.is-framed, html.is-framed body { height: 100%; overflow: hidden; }
html.is-framed body { display: block; margin: 0; background: var(--app-backdrop); }

.device-stage {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
}

/* Reserves the scaled footprint so centring works. */
.device-slot { flex-shrink: 0; }

.device {
  width: 430px; height: 880px;
  border: 10px solid var(--brand-navy);
  border-radius: 3rem;
  background: var(--card-bg);
  box-shadow: 0 25px 50px -12px rgba(32, 42, 55, .35);
  overflow: hidden;
  position: relative;
  transform-origin: top left;
}

.device-notch {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 128px; height: 24px; border-radius: 0 0 16px 16px;
  background: var(--brand-navy); z-index: 5000;
}

/* Status bar - same size, glyphs and 9:41 as the GP app. */
.device-status {
  position: absolute; top: 0; left: 0; right: 0; height: 50px;
  padding: 24px 16px 0;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card-bg); color: var(--text-dark);
  z-index: 4000;
}
.device-status .time { font-size: 12px; font-weight: 600; font-family: var(--font-family); }
.device-status .icons { display: flex; align-items: center; gap: 6px; }
.device-status .batt { width: 24px; height: 12px; border: 1.5px solid currentColor; border-radius: 3px; display: flex; align-items: center; padding: 0 2px; }
.device-status .batt i { display: block; height: 6px; width: 16px; border-radius: 1.5px; background: currentColor; }
html.status-light .device-status { background: var(--partner-deep); color: #fff; }

/* The screen. It is transformed, so the app's fixed bars, sheets and
   toasts are held inside the phone instead of the browser window. The
   inner scroller moves the page while those bars stay put. */
.device-screen {
  position: absolute; top: 50px; left: 0; right: 0; bottom: 0;
  transform: translateZ(0);
  overflow: hidden;
}
.device-scroll {
  position: absolute; inset: 0;
  overflow-y: auto; overflow-x: hidden;
  scrollbar-width: none;
}
.device-scroll::-webkit-scrollbar { display: none; }

/* Full-height screens fill the phone, not the browser window. */
html.is-framed .mobile-container { max-width: none; min-height: 100%; box-shadow: none; }
html.is-framed .splash,
html.is-framed .auth,
html.is-framed .verify { min-height: 830px; }

/* Bars pinned to the bottom of the phone. */
html.is-framed .sticky-action,
html.is-framed .bottom-nav { max-width: none; }
