/* ============================================================
   THE FLOOR, ON A PHONE
   ============================================================
   Loaded LAST on every page, after the page's own stylesheet. That is the
   whole point of it and it is why it is a separate file.

   Everything in here is a minimum: a smallest readable size and a smallest
   tappable area. A minimum has to be able to win, and a media query adds no
   weight to a selector, so a rule written in style.css to raise something
   loses to a plainer rule in pricing.css or paths.css that happens to load
   later. Several such rules were already doing nothing for exactly that
   reason. Collecting the floor in one file that loads after all of them is
   the only arrangement where "no smaller than this" is true.

   It is NOT a place for design. Nothing here changes a colour, a layout or a
   size on a desktop. If a rule here is doing more than enforcing a minimum,
   it is in the wrong file.

   Every number below was measured in a real browser at 390x844 with touch
   emulation on, which is where the numbers in the comments come from.
   ============================================================ */

@media (max-width: 900px) and (pointer: coarse), (max-width: 640px) {

  /* ── 1. Nothing a person has to read goes below 12px ──────────────────────
     Measured, and these were the ones under it:

       .lp-badge                  10.88px   the level tag on a learning path
       .pay-where                 10.88px   which card pays, on pricing
       .cover-topic               10.56px   the topic on a course cover
       .cover-count               11.2 px   the lesson count on a course cover
       .stat-label                11.2 px   the word under every big number
       .reaction-btn              11.2 px   the counts beside a post
       .post-time                 11.52px   when a post was written
       .lp-card-level             11.52px   the level inside a path card
       .s-label                   11.52px   the small print under a price
       .pf-category               11.52px   the category on a portfolio item
       .academy-plan-cycle-note   11.84px   what a yearly plan really costs

     Twelve rather than fourteen because these are all secondary: a label
     under a number, a date, a count. Raising them to body size would flatten
     the hierarchy the page is built on and push every card taller. Twelve is
     the smallest size that stays legible on a phone held at arm's length,
     and it is the floor Android's own type scale stops at.

     A flat 12px, not max(12px, 1em). There is no way to write "whichever is
     larger, twelve or whatever this element already had", because the
     declaration IS the element's size: by the time it is read, the old value
     is gone. In max(12px, 1em) the em resolves against the PARENT, so on a
     16px card every one of these would jump to 16px and the hierarchy the
     page is built on would flatten. Each class below has one definition and
     every one of them measured between 10.56 and 11.84px, so a flat floor
     raises all of them and lowers none.

     !important, and it is the right tool here rather than a shortcut.

     Loading last is not enough on its own. The first version of this file
     relied on order and half of it silently did nothing, because the rules
     it was up against are more specific, not merely earlier:

       .pricing-section .s-label      pricing.css
       .site-ultra .stat-label        ultra.css
       .app-body .reaction-btn        community-ultra.css

     and several more are written in a <style> block inside the page itself,
     which lands after every <link> no matter what order the links are in.

     The alternatives are worse. Matching each one's specificity means this
     file has to know that a stat label lives under .site-ultra and a price
     label under .pricing-section, which makes a floor that quietly stops
     applying the day somebody renames a wrapper. Raising everything to
     .site-ultra assumes a body class that pages with their own <body> tag do
     not carry.

     The scope is what makes it safe: one short file, phones only, and every
     declaration in it is a minimum. There is nothing here for an !important
     to steal a design decision from. */
  .lp-badge,
  .pay-where,
  .cover-topic,
  .cover-count,
  .stat-label,
  .post-time,
  .lp-card-level,
  .s-label,
  .pf-category,
  .price-note,
  .ac-save,
  .story-name,
  .story-hint,
  .academy-plan-cycle-note,
  .reaction-btn,
  /* Second sweep, after the first one was applied and the page re-measured.
     These are what was left under twelve:

       .mobile-nav-item span       9.60px   the labels in the bottom tab bar
       .trend-n                   10.37px   the count beside a trending tag
       .feed-period-tab           10.88px   Today / This week / All time
       .mrf-chat-header-status    11.52px   "Online. Here to help"
       .academy-plan-badge        11.52px   Most Popular, Best Value
       .trend-tag                 11.52px   the trending tag itself

     The bottom tab bar is the worst of them and the easiest to miss: at
     9.6px those five labels are the main navigation on a phone, under half
     the size of the body text above them. Twelve is also exactly what
     Material gives a bottom navigation label, so this is the standard size
     rather than a preference. The icons stay as they are. */
  .mobile-nav-item span,
  .trend-n,
  .trend-tag,
  .feed-period-tab,
  .mrf-chat-header-status,
  .academy-plan-badge      { font-size: 12px !important; }

  /* A phone has no escape key.
     The command palette prints a little ESC hint beside its search box, at
     10.88px. Growing it would be answering the wrong question: on a touch
     screen the hint is not small, it is wrong. Tapping outside still closes
     the palette, which is what a phone expects anyway. */
  #u-cmd kbd               { display: none; }

  /* Those two are set from a style block inside the page itself, which lands
     after this file. One extra element in the selector is enough to outrank
     them without resorting to !important. */
  div.academy-plan-cycle-note { font-size: 12px !important; }

  /* ── 2. Filter pills get a finger-sized target without getting bigger ─────
     The pills were deliberately brought down to 36px high further up the
     stack, because eleven of them over three rows were pushing the heading
     off a phone screen. That decision stands: the reason for it has not
     changed and growing them back would undo it.

     What was wrong was treating the drawn size and the touch size as the
     same number. They are not. An absolutely positioned ::after inside the
     pill extends what a finger can hit to 44px while the pill still draws at
     36, because hit-testing a generated box targets the element that
     generated it.

     Vertical only. Sideways it would reach into the neighbouring pill, and a
     near miss landing on the wrong category is worse than landing on
     nothing. The rows are horizontal, so there is nothing above or below to
     take a tap from.

     Measured after: .academy-filter-pill 46x36 drawn, 44 tall to a finger. */
  .academy-filter-pill,
  .pf-tab,
  .cur-pill,
  .prof-tab                { position: relative; }
  .academy-filter-pill::after,
  .pf-tab::after,
  .cur-pill::after,
  .prof-tab::after {
    content: '';
    position: absolute;
    left: 0; right: 0;
    top: -4px; bottom: -4px;
  }

  /* The row has to let it out.
     .academy-filter-row is overflow:auto so the pills can scroll sideways, and
     overflow-x on its own is not a thing: asking for one axis gives you the
     other as well. Measured it at padding-top 0 and padding-bottom 6px, so the
     4px underneath each pill survived and the 4px above was clipped off, which
     is why the first version of this rule bought 36px to 40px instead of 44.
     Padding makes the room, a matching negative margin gives it back, and the
     row sits exactly where it did.

     Top only. The bottom is where these rows already carry padding, so the
     lower half of the target was never being clipped, and setting a figure
     there would mean overwriting whatever each row was given rather than
     making room: .academy-filter-row has 6px, and writing 4px would quietly
     close the gap under it. A rule meant to enforce a minimum must not
     shrink anything on its way past. */
  .academy-filter-row,
  .pf-filter-tabs,
  .cur-pills {
    padding-top: 4px;
    margin-top: -4px;
  }

  /* Readable labels on those same pills. They were .74rem, 11.84px, and a
     filter you cannot read is not a filter. 13px because this one IS the
     control's own label rather than a note beside it. */
  .academy-filter-pill,
  .pf-tab,
  .cur-pill,
  .prof-tab                { font-size: 13px !important; }

  /* ── 3. Inline links clear 24px ───────────────────────────────────────────
     WCAG 2.2 asks for 24 by 24 as the pass mark, and these were under it:

       .post-tag        63x20   a hashtag inside a post
       .ldr-name-link   55x20   a name on the leaderboard podium

     Vertical padding on an inline element grows the box a tap lands in
     without touching the line box, so the row it sits in does not move a
     pixel. Nothing shifts, nothing reflows, and the target clears 24.

     The feed's author links and avatars are left alone: 48x24 and 38x38
     already pass, and the avatar cannot grow without the card growing with
     it. */
  a.post-tag,
  a.ldr-name-link          { padding-block: 4px !important; }
}
