/* Native-sized mobile app; the device mockup remains desktop-only. */
@media (max-width:730px), (max-width:1024px) and (pointer:coarse) {
  html { width:100%; height:auto; overflow-x:clip; overflow-y:auto; overscroll-behavior:auto; scroll-padding-bottom:104px; }
  body { width:100%; height:auto; min-height:100svh; overflow:visible; overscroll-behavior:auto; background:var(--paper); }
  html.page-scroll-locked { overflow:hidden; }
  body.page-scroll-locked { position:fixed; top:var(--millo-scroll-offset,0px); left:0; right:0; width:100%; overflow:hidden; }
  .prototype-header, .prototype-footer, .ambient-title { display:none; }
  .stage { display:block; width:100%; height:auto; min-height:100svh; padding:0; margin:0; }
  .stage > .phone {
    display:block; width:100%; max-width:none; height:auto; min-height:100svh; padding:0; margin:0;
    border:0; border-radius:0; background:none; box-shadow:none;
  }
  .stage > .phone::before, .stage > .phone::after,
  .stage .camera, .stage .status-bar, .stage .home-indicator { display:none; }
  .stage .screen { height:auto; min-height:100svh; overflow:visible; border:0; border-radius:0; }
  .stage .phone .screen-content {
    width:100%; height:auto; min-height:100svh; overflow:visible;
    padding:calc(8px + env(safe-area-inset-top, 0px))
      calc(20px + env(safe-area-inset-right, 0px))
      calc(104px + env(safe-area-inset-bottom, 0px))
      calc(20px + env(safe-area-inset-left, 0px));
    overscroll-behavior:auto;
    scroll-padding-top:24px; scroll-padding-bottom:104px;
  }
  .stage .screen-content > * { min-width:0; max-width:100%; }
  .stage .glass-nav {
    position:fixed; left:calc(16px + env(safe-area-inset-left, 0px));
    right:calc(16px + env(safe-area-inset-right, 0px));
    bottom:calc(12px + env(safe-area-inset-bottom, 0px));
    height:60px; padding:5px; z-index:20;
  }
  .stage .glass-nav a { min-width:44px; height:48px; }
  .stage .icon-button, .stage .avatar, .stage .back-button { min-width:44px; min-height:44px; }
  .stage .market-toggle { width:44px; height:44px; flex-basis:44px; }
  .stage .period-toggle button { min-height:44px; min-width:44px; }
  .stage .all-markets { min-height:44px; }
  .stage .market-carousel { max-width:170px; }
  .stage .ai-markets button { width:44px; height:44px; display:grid; place-items:center; }
  .stage .ai-scope-bottom { flex-wrap:wrap; }
  .stage .ai-periods button { min-height:44px; }
  .stage input:not([type=checkbox]):not([type=radio]), .stage select, .stage textarea,
  .sheet input:not([type=checkbox]):not([type=radio]), .sheet select, .sheet textarea { font-size:16px; }
  .stage .full-button, .stage .soft-button, .sheet-primary, .sheet-secondary { min-height:48px; }
  .stage .lab-tabs button { min-height:44px; }
  .stage .segmented button, .sheet .product-tabs button,
  .stage .text-button, .stage .ai-detail-link { min-height:44px; }
  .stage .ai-detail-link { min-width:44px; }
  .stage .section-topbar { padding-top:8px; }
  .stage .sheet-platform-row { min-height:76px; }
  .overlay {
    padding:calc(12px + env(safe-area-inset-top, 0px))
      calc(12px + env(safe-area-inset-right, 0px))
      calc(12px + env(safe-area-inset-bottom, 0px))
      calc(12px + env(safe-area-inset-left, 0px));
    align-items:flex-end;
  }
  .overlay .sheet {
    width:100%; max-width:560px; margin:0;
    max-height:calc(100dvh - 24px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    padding:24px; border-radius:28px; overflow-x:hidden;
  }
  .overlay .sheet-close { width:44px; height:44px; }
  .toast { max-width:calc(100% - 32px); bottom:calc(86px + env(safe-area-inset-bottom, 0px)); }
  .millo-intro { padding:0; }
  .intro-frame {
    width:100%; max-width:none; height:100vh; height:100dvh;
    padding:calc(20px + env(safe-area-inset-top, 0px))
      calc(24px + env(safe-area-inset-right, 0px))
      calc(20px + env(safe-area-inset-bottom, 0px))
      calc(24px + env(safe-area-inset-left, 0px));
    border:0; border-radius:0; box-shadow:none;
  }
  .intro-skip, .intro-dots button { min-height:44px; }
  .intro-dots button { width:32px; }
}
@media (max-width:430px) {
  .overlay .date-range-fields { grid-template-columns:minmax(0,1fr); }
}
@media (max-width:360px) {
  .stage .phone .screen-content { padding-left:calc(16px + env(safe-area-inset-left, 0px)); padding-right:calc(16px + env(safe-area-inset-right, 0px)); }
  .stage .period-selector { flex-wrap:wrap; row-gap:10px; }
  .stage .period-toggle { margin-left:auto; }
  .stage .glass-nav { left:12px; right:12px; }
  .stage .glass-nav a { gap:4px; }
  .overlay .sheet { padding:20px; }
  .stage .lab-fields { grid-template-columns:minmax(0,1fr); }
}
@media (max-height:500px) and (max-width:1024px) and (pointer:coarse) {
  .intro-visual { height:160px; }
  .intro-header { margin-bottom:12px; }
  .intro-footer { padding-top:8px; }
}
