/* ═══════════════════════════════════════════════════════════════════════════════════════════
   los-phone.css — THE LOS ON A PHONE. The other half of los-desktop.css.

   ⭐ Christa, 2026-09-04:
     "there are gonna be times that potentially a loan officer's on the field and needs to do
      something in the file that's in a live file and active in order for them to like lock a
      loan or do something ... remember this is desktop first... but it needs to have a mobile
      friendly view too.... JUST in case."

   WHAT THIS IS NOT: a responsive redesign. The LOS stays desktop-first — that decision is hers
   from 8/22 and nothing here touches it.

   WHAT IT IS: the difference between "does not scroll sideways" and "a thumb can hit it."
   Measured 9/4 — every one of the 40 LOS screens that render inside 390px already had ZERO
   horizontal overflow, so by the old measure they all passed. Then /los/lock, the exact screen
   her field-LO scenario needs, turned out to have its two real actions — "Request a lock…" and
   "Confirm the lock…" — at 32px and 30px tall. It looked perfect in a screenshot and could not
   be operated in a driveway. Across all 40 screens the audit found 1025 controls under 44px.

   THE FLOOR: 44px, Apple HIG. Material says 48dp; 44 is the lower of the two and the one this
   build holds. Enforced by verify-los-touch.mjs.

   FOUR RULES, so this does not become a blunt instrument:
   1. ⛔ NOTHING HERE FIRES ABOVE 560px. A 30px button under a mouse is correct and dense, and
      density is the whole point of a desktop-first LOS. Mirror image of los-desktop.css, which
      fires only above 1280px. Between the two, the tablet range is untouched by both.
   2. ⭐ CONTROLS ONLY, never inline links. WCAG 2.5.8 sets 24px and explicitly EXEMPTS a link
      inside a sentence — padding every breadcrumb to 44px would make each page enormous and fix
      nothing a thumb was missing. The first version of the audit counted those and reported
      1080 findings that were 90% noise; a list nobody can act on gets ignored entirely.
   3. `min-height`, not `height`. A control whose content already needs more room keeps it; this
      only ever raises a floor. Nothing shrinks, so no label can be clipped by this file.
   4. Row-level `display` is left alone except where a min-height cannot apply — a bare `inline`
      element ignores min-height, so those get `inline-flex` and nothing else.
   ═══════════════════════════════════════════════════════════════════════════════════════════ */

@media (max-width: 560px) {

  /* ── The targets. Buttons, real inputs, and links that are already styled as boxes (tabs,
     chips, pills, cards). A bare <a> in running text is deliberately absent. ── */
  button,
  [role="button"],
  [role="tab"],
  [role="switch"],
  summary,
  select,
  textarea,
  input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]),
  a[class*="btn"], a[class*="Btn"],
  a[class*="tab"], a[class*="chip"], a[class*="pill"] {
    min-height: 44px;
  }

  /* ⭐ A LINK INSIDE <nav> IS A TARGET, whatever it is called. The remaining findings after the
     first two passes were almost all sub-nav tabs — "1003 / URLA", "UW conditions", "Overview",
     "Funnel" — at 25-34px. They carry no btn/tab/chip class, and chasing their class names per
     screen would go stale the next time somebody adds one. They all live inside a <nav>, so the
     rule is structural: navigating is tapping, and a tap target is 44px. This deliberately does
     NOT catch a link in a paragraph, which is the exemption rule 2 is about. */
  nav a, [role="tablist"] a, [role="navigation"] a,
  /* ⚠️ Not every jump-nav is a <nav>. Three screens build theirs from a div (`.jump-nav`,
     `.jump`, `.jnav`) and their links measured 17px — the smallest targets in the whole LOS.
     Named explicitly rather than left to a semantic rule they do not follow. */
  /* ⚠️ FOUR spellings of the same idea across the LOS: `.jump-nav`, `.jump`, `.jnav`, `.jumpnav`.
     The fourth only surfaced on PRODUCTION (/los/coc), because that screen renders sections the
     local seed does not. Matching on the hyphen-optional set rather than picking a winner —
     renaming five screens' markup to satisfy a stylesheet is the tail wagging the dog. */
  .jump-nav a, .jump a, .jnav a, .jumpnav a, .stickybar a, .secnav a,
  /* The breadcrumb strip: `.bar > a` is "← My desk" / "← File", the way back out of a screen.
     Direct-child only, so a link inside a sentence that happens to sit in a bar is untouched. */
  .bar > a {
    min-height: 44px;
    /* ⭐ Width again. Production showed `← File` at 36x44 — the height rule had landed and the
       min-width rule below only listed buttons and class-styled links, so a two-character
       breadcrumb stayed a third of a thumb wide. Same lesson as the icon buttons, one layer up:
       a target is the SMALLER side. */
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* ⚠️ !important, and only here. The companion's own `.chips button{min-height:38px}` is a
     class selector and beats a bare `button` rule no matter how this file is ordered — its
     filter chips stayed 38px through three passes. This is an ACCESSIBILITY FLOOR inside a
     phone-only media query: it must win, it can only ever raise a value, and it cannot reach
     desktop. That is the case !important is actually for.
     ⛔ Scope creep check: min-height and min-width ONLY. Never colour, spacing or layout. */
  button, [role="button"], select, textarea, summary,
  input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]) {
    min-height: 44px !important;
  }

  /* ⛔⛔ THE REGRESSION THIS RULE EXISTS TO UNDO — shipped to production 9/4 and caught by
     LOOKING at the screen, not by any number. Every guard was green: overflow 0, targets 44px.
     And the tab strip on /los/lock rendered as seven overlapping circles with the labels spilling
     across each other.

     Cause: those tabs live in a flex row. Giving them `display:inline-flex` above made them flex
     ITEMS, so they inherited the row's shrink and collapsed to the 44px min-width I had just set,
     while their text kept its own width and ran out of the box.

     `flex:0 0 auto` says size to your content and do not shrink; `white-space:nowrap` stops a
     two-word label wrapping to a sliver. min-width can then only ever ADD room to something
     genuinely tiny, which was the whole intent.

     ⭐ The lesson, written where the next person will hit it: a tap-target floor is a LAYOUT
     change. Measuring the target and never looking at the row it sits in is how you ship this. */
  /* Do-not-shrink is safe for everything: it only stops a flex parent squeezing a control
     narrower than its content, which is the collapse described above. */
  nav a, [role="tablist"] a, [role="navigation"] a,
  .jump-nav a, .jump a, .jnav a, .jumpnav a, .stickybar a, .secnav a, .bar > a,
  button, [role="button"], summary,
  a[class*="btn"], a[class*="tab"], a[class*="chip"], a[class*="pill"] {
    flex: 0 0 auto;
  }

  /* ⚠️ nowrap is NOT safe for everything, and pairing it with the rule above was a second
     regression on top of the first — caught by the new spill check before it shipped, which is
     the only reason this file does not have a third bug in it.
     A tab or a chip is one short label and must stay on one line. A card-shaped button is not:
     /los/forms lists "Uniform Residential Loan Application (URLA)" in a 348px box and /los/mobile
     stacks whole task rows. Those WRAP by design, and nowrap turned 89 of them into text running
     off the side of its own card. So nowrap goes to the nav-ish selectors only. */
  nav a, [role="tablist"] a, [role="navigation"] a,
  .jump-nav a, .jump a, .jnav a, .jumpnav a, .stickybar a, .secnav a, .bar > a,
  a[class*="tab"], a[class*="chip"], a[class*="pill"] {
    white-space: nowrap;
  }

  /* min-height is inert on a purely inline box, so give those a flex context and nothing more.
     :not([hidden]) keeps a deliberately hidden control from being forced visible-sized. */
  button:not([hidden]),
  [role="button"]:not([hidden]),
  a[class*="btn"]:not([hidden]),
  a[class*="tab"]:not([hidden]),
  a[class*="chip"]:not([hidden]) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* A control that is deliberately laid out as a full-width block stays one — inline-flex above
     would otherwise shrink it to its text and break a stacked form. */
  button.block, button.full, button.wide,
  a.btn.block, a.btn.full, .btn-row > button, .btn-row > a {
    display: flex;
    width: 100%;
  }

  /* ⭐ WIDTH COUNTS TOO. After the first pass the icon buttons on /los/settings measured 22x44:
     the floor had fixed the height and left them a quarter of a thumb wide. A target is the
     SMALLER side, not the taller one. min-width only ever raises, so a wide text button is
     untouched by this. */
  button, [role="button"], summary,
  a[class*="btn"], a[class*="tab"], a[class*="chip"], a[class*="pill"] {
    min-width: 44px;
  }

  /* ⚠️ I EXCLUDED TABLE BUTTONS HERE AND IT WAS WRONG — reverted the same hour.
     The reasoning sounded right: forcing 44px into a dense table cell makes a table taller and
     therefore harder to read. Then the audit showed what it actually exempted: the `Lock`
     buttons on /los/secondary, 42x18, sitting in a table. That is the lock desk's real action
     and very close to the exact thing Christa described a field LO needing. An exclusion that
     happens to remove the one control the feature exists for is not a nuance, it is a bug with
     a justification attached. Tables get the floor like everything else; overflow is still 0
     and a longer scroll on a phone is a cheaper price than an 18px button. */

  /* Fields a thumb has to type into. iOS zooms the whole page when a focused input is under
     16px, which then leaves the layout scrolled sideways — the bug this file exists to avoid,
     arriving by a different door. */
  input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),
  select, textarea {
    font-size: max(16px, 1em);
  }
}
