/* Helium Notes — phones (2026-11-28). The app was laid out for the tablet first; these rules make every window fit a
   phone screen: sheets dock at the bottom and use the full width, the big windows (Settings, Go Premium, wide sheets)
   fill the screen, and rows that sit side by side on the tablet stack on a narrow screen. Loaded last; the "html"
   prefix wins over styles the modules add at run time. Tablets and computers are not touched (max-width 640px). */
@media (max-width: 640px) {
  html .scrim { padding: 0; place-items: end stretch; }
  html .scrim > .sheet { width: 100% !important; max-width: 100% !important; max-height: 92dvh; border-radius: 22px 22px 0 0; }
  html .scrim.setx > .sheet, html .scrim.premx > .sheet, html .scrim > .sheet.wide, html .scrim.fullpg > .sheet {
    height: 100dvh !important; max-height: 100dvh !important; border-radius: 0; }
  html .sheet header { padding-left: 16px; padding-right: 8px; }
  html .sheet .sb { padding-left: 16px; padding-right: 16px; }

  /* Settings: plan card and section tabs on top, the pane below */
  html .stx-l { padding: 10px 12px 6px; }
  html .stx-r { padding: 14px 16px 28px; }
  html .stx-nav { scrollbar-width: none; }

  /* My Profile */
  html .pf-top { flex-wrap: wrap; }
  html .capy-say { flex-wrap: wrap; }
  html .capy-say > div { flex: 1 1 160px; min-width: 0; }
  html .capy-say .sb2 { margin-left: 0; width: 100%; justify-content: center; }
  html .pf-dl { grid-template-columns: 1fr 1fr; }
  html .pf-acts { flex-wrap: wrap; }
  html .pf-acts > button { flex: 1 1 auto; }

  /* buttons in a row at the bottom of a sheet wrap instead of running off the edge */
  html .acts { flex-wrap: wrap; }
  html .inv-code { font-size: 19px; letter-spacing: 2px; }

  /* themes shop: two cards per row */
  html .th-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

  /* Capy nudge and celebration fit the width */
  html .capy-nudge { left: 10px; right: 10px; transform: none; max-width: none; flex-wrap: wrap; }
  html .capy-nudge > div:not(.acts2) { flex: 1 1 150px; }
  html .cel-c { min-width: 0; width: calc(100% - 48px); }

  /* welcome tour */
  html .wt-ill { width: 150px; height: 136px; }
  html .wt h2 { font-size: 24px; }

  /* menus never wider than the screen */
  html .menu { max-width: calc(100vw - 16px); }
  html .menu.ai-menu { width: calc(100vw - 16px); }

  /* Read PDF: Capy chat and search fill the width */
  html .rd-sr, html .rd-chat { left: 8px; right: 8px; width: auto; top: 58px; bottom: 70px; }
  html .th-m { flex-wrap: wrap; }

  /* note editor: every button of the top bar fits (the "Home" word hides, the arrow stays) */
  html .etb { gap: 0; padding: 6px 4px; }
  html .etb .ib { width: 36px; height: 40px; }
  html .etb .backb #backName { display: none; }
  html .etb .backb { padding: 0 6px; min-width: 40px; }
}

/* tablets held upright: the big windows use more of the tall screen */
@media (min-width: 641px) and (orientation: portrait) {
  html .scrim.setx > .sheet { height: min(92dvh, 1180px); }
}
