/* The site's single-card pages on phones (up to 600px): Settings, Updates
   and a post, the Character Library, the usage page, log in and the
   password pages, Contact, the legal pages and Install. Their <body> has
   .page-phone, the wrapper around the card .page-wrap, the card .page-sheet.

   Owner, 2026-11-20: as the story pages (static/css/story_phone.css), the
   card is the page there — the screen's width, no frame, no shadow — on the
   phone chat's colour: white, and near-black #1e1926 in dark
   (dark_extra.css). The card had 41px of page on each side and up to 40px of
   its own padding: the legal pages' text was 228px of a 390px screen.
   Desktop keeps the card on its page. Loaded by
   templates/components/page_phone_head.html; a source of the dark scheme
   (scripts/build_dark_css.py SOURCES). */

@media (max-width: 600px) {
  body.page-phone {
    display: block !important;
    padding: 0 !important;
    background: #ffffff;
  }

  /* Separate: a browser without :has() drops only this rule. iPhone Safari
     tints the strips around its status bar from the page's background. */
  html:has(> body.page-phone) {
    background: #ffffff;
  }

  body.page-phone .page-wrap {
    display: block !important;
    width: 100%;
    max-width: none !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 14px 0 32px !important;
  }

  body.page-phone .page-sheet {
    width: 100%;
    max-width: none !important;
    margin: 0 !important;
    padding: 12px 20px 28px !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    animation: none !important;
  }

  /* A page whose card is its whole body (the usage page). */
  body.page-phone > .page-sheet {
    padding-top: 20px !important;
  }

  /* Log in's "Go to home page" sat in the top corner, over the card's
     heading once the page's margins were gone: a line of its own. */
  body.page-phone .page-corner-link {
    position: static;
    padding: 14px 20px 0;
    text-align: right;
  }

  /* Whatever sits in the wrapper beside the card (a back link, a flash
     message, an admin's preview banner) lines up with the card's text
     rather than touching the screen's edges. */
  body.page-phone .page-wrap > :not(.page-sheet) {
    margin-left: 20px;
    margin-right: 20px;
  }
}
