html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg-shell, #0a0a0a);
}

#root {
  min-height: 100vh;
  background: var(--bg-shell, #0a0a0a);
}

/* Form rows on a phone: one field per line.
 *
 * The wizards lay their fields out two or three to a row, which a phone cannot
 * hold. At 360px a three-field row gives each box about 90px, so "Static IP
 * address" wrapped to two lines and pushed its own input 20px below the two
 * beside it, and an address like 197.248.234.141 was cut to "197.248". Making
 * the text smaller does not fix that: the label still does not fit in 90px.
 * One column does, and it puts every label and every input on the same two
 * edges.
 *
 * Here rather than in each wizard's <style> block, so one rule covers every
 * form that opts in with className="form-row", and !important because each
 * row's columns are an inline style, which a stylesheet cannot otherwise
 * override. An empty spacer div (PPPoE's three-column row) is dropped, or it
 * would leave a gap under the last field. A div only: an <input> has no
 * children either, so a bare :empty would hide a field placed straight in
 * the row. */
@media (max-width: 560px) {
  .form-row { grid-template-columns: minmax(0, 1fr) !important; }
  .form-row > div:empty { display: none; }
}

/* Smaller text on phones, site-wide: 90%.
 *
 * Every font size in the app is an inline px value, hundreds of them, so there
 * is no root size to turn down. Zoom scales the whole page instead, spacing
 * with the text, so nothing changes shape: a 360px phone lays the site out as
 * a 400px one, which is the width most mid-range phones already have. Media
 * queries and window.innerWidth still read the real screen, so every phone
 * breakpoint (this file's 560px, the 768px header and bottom nav) switches
 * exactly where it did. 768px is where the site's own mobile view begins.
 *
 * 0.9 is the floor worth going to: the smallest hints are 10 to 11px, which
 * render at 9 to 10px here. Lower than that and they stop being readable.
 *
 * The one thing zoom changes is 100vh: it is zoomed too, so a box that was
 * "at least the screen" became 90% of it, and the admin sign in showed a band
 * of the wrong colour along the bottom. Every box that has to fill the screen
 * on a phone is listed here and divided back up. A new full-screen wrapper
 * takes className="fill-screen". */
@media (max-width: 768px) {
  :root { --phone-zoom: 0.9; }
  html { zoom: var(--phone-zoom); }
  #root, .app-shell-root, .admin-shell, .fill-screen { min-height: calc(100vh / var(--phone-zoom)) !important; }
}
