/* longtail.css -- long-tail families' readability floor.
   Owner: long-tail visual task (scripts/longtail_css.py).  Loaded after
   style.css by scripts/site_postprocess.py (step "longtail", declared in
   scripts/postprocess_chain_decl.py).  Every selector is `main`-prefixed, so
   the floor wins on specificity and nothing here depends on source order.  Body-text floor and
   tap-target floor only; no colour, no spacing-scale, no layout redesign.

   Measured baseline (visual_gate.py, 66 pages x 2 viewports, 2026-10-29):
   fontsize 110/132 viewport-runs FAIL, target 105/132, overflow 1. */

/* --- 1. Body-text floor -------------------------------------------------
   Every long-tail family shipped meta/provenance/lede copy at 12-13.5px.
   --fs-small is 14px, the floor the gate enforces for p/li/td/dd/etc. */
main :is(.rl-card p,.rl-mut,.rl-note,.tr-card p,.tr-mut,.tr-note,.tr-stats li,.tr-case dl,.adcv-card p,.adcv-mut,.adcv-note,.adcv-case dl,.fr-card p,.fr-mut,.freshness,.srcline,.src,.table-wrap.card thead th,.table-wrap.card tfoot th,.table-wrap td code,.prov,.prov-list dd,.prov table.data td,.prov table.data th,.uflpa-mut,.uflpa-footnote,.uflpa-count,.uflpa-batch td,.legend,.scope-note,.hs-table th,.hs-table td,.hs-rate-box .hs-rate-alt,.ds-fields tbody td,.ds-tbl th,.ds-tbl td,.ds-note,.ds-dl dd code,.comd-note,.comd-snap,.cmc-snap,.regime-cell p,.insight p,.card p,.pl-card p,.pl-note,.signup-more p,.facts li,.search-status,.search-suggest-label,.search-tip,.sample-note,.source-strip,.hit-meta,.hit-alias,.via-tag,.bis-note,.ukt-note,.trunc-note,.tl-legend,.kicker,.cap,.muted,.note,.dim,.queryline,.subalt,.empty,.edge-eyebrow,.field-hint,.breadcrumbs,.trust-row,.chips,.vintage,table.data th,table.data td,.ch-index,figcaption,.pv-cap,.scroll-hint,.card .pos,.idx,.pw-hint,.acct-note,.acct-lock,.ds-term,.probe-hts){font-size:var(--fs-small)}

/* The three classes the generators write as an inline style attribute on the
   element (13px / 12.5px / 13px).  Inline styles outrank any selector, so this
   group needs !important; nothing else in this file does. */
main :is(.data-freshness,.vintage-badge,p.fr-mut){font-size:var(--fs-small)!important}

/* Body tags that carry the size in a style attribute with no class at all
   (measured: 2,386 such elements in the tree, and only three distinct values
   below the floor -- 12px x15, 12.5px x934, 13px x1,437; no em/rem forms, so
   two literal prefixes cover all of them and no deliberately larger inline
   size is touched). */
main :is(p,li,td,dd,blockquote,figcaption)[style*="font-size:12"],
main :is(p,li,td,dd,blockquote,figcaption)[style*="font-size: 12"],
main :is(p,li,td,dd,blockquote,figcaption)[style*="font-size:13"],
main :is(p,li,td,dd,blockquote,figcaption)[style*="font-size: 13"]{
  font-size:var(--fs-small)!important}

/* The ruling body itself: <pre class="rule-text"> was 13px on all 2,350 ruling
   detail pages, i.e. the page's primary content was the smallest text on it
   (flagged P0 "wall of micro-text" by the visual review of
   frames/final/rulings-ruling-1440x900.png).  The gate's fontsize check reads
   p/li/td/dd only, so this one is fixed from the review, not from the gate. */
main pre.rule-text{font-size:var(--fs-small);line-height:1.72}

/* --- 2. Tap-target floor ------------------------------------------------
   Rows that are only a link (ruling/member/notice directory cells, port and
   adcv link lists, definition-list values, footnote rows) rendered 15-17px
   tall.  --tap-min is 44px.  The negative block margin keeps the row rhythm
   of the existing design: the box a finger hits is 44px, the ink stays put. */
main :is(li,dd,td,blockquote,figcaption)>a:only-child{
  display:inline-flex;align-items:center;justify-content:center;
  min-height:var(--tap-min);min-width:var(--tap-min);margin-block:-13px}

/* A page-level link row that is not a list (the "All trade remedy orders"
   back link, "Read this notice on federalregister.gov", the EU measure's HS
   link): one <p> directly under <main> whose only element child is the link.
   Scoped to main's direct children so prose links inside section.prose keep
   their inline rhythm. */
main>p>a:only-child{display:inline-flex;align-items:center;min-height:var(--tap-min);
  margin-block:-13px}

/* Link-list modules: a row of chips/codes where each <li> holds one or more
   links (ruling family cross-links, adcv country products, hs chapter list).
   Enumerated by module class rather than "every li > a" so a prose list item
   that merely mentions a link keeps its line rhythm. */
main :is(.rl-famlinks,.adcv-products,.chapter-list,.rl-meta,.uflpa-prov-ref) a{
  display:inline-flex;align-items:center;justify-content:center;
  min-height:var(--tap-min);min-width:var(--tap-min)}

/* Breadcrumbs: desktop already declared 44px on --tap-min but the mobile
   override (24px) won, and "Home" measured 37px wide.  Both axes, both
   viewports, one rule. */
main :is(.breadcrumbs,.crumbs) a{
  display:inline-flex;align-items:center;justify-content:center;
  min-height:var(--tap-min);min-width:var(--tap-min)}

/* Off-canvas skip link: 12px padding + 16px/1.2 line box = 43.2px, a 0.8px
   miss on the floor.  Same control, rounded up. */
body>a.skip-link{display:inline-flex;align-items:center;min-height:var(--tap-min)}

/* Source / provenance lines and meta rows: their inline links ("Read the
   Federal Register notice", the PortWatch query URL, the Wayback snapshot)
   are the only thing on the line. */
main :is(.prov,.srcline,.freshness,.data-freshness,.tr-prov,.fr-mut,.src,.rl-note,
         .rl-mut,.adcv-mut,.adcv-note,.tr-mut,.tr-note,.uflpa-mut,.uflpa-footnote,
         .vintage-badge,.scope-note,.ds-cite,.source-strip) a{
  display:inline-flex;align-items:center;justify-content:center;
  min-height:var(--tap-min);min-width:var(--tap-min)}

/* Agency / category chips that are links inside a paragraph ("ITA", "CBP"):
   41x26 measured.  Chip look preserved, hit box on the floor. */
main p>a.badge{display:inline-flex;align-items:center;justify-content:center;
  min-height:var(--tap-min);min-width:var(--tap-min);margin-block:-9px}

/* Footnote markers injected by the geo-cite pass: a 4x11px asterisk link in a
   sentence.  Padding grows the hit box to 44x44 and the equal negative margin
   puts the layout footprint back, so the ink does not move and no column
   widens. */
main sup.geo-cite>a{display:inline-block!important;padding:17px 20px!important;
  margin:-17px -20px!important;min-width:var(--tap-min);min-height:var(--tap-min)}

/* --- 3. Overflow guard --------------------------------------------------
   One 189-page family pulled a long company name into a sticky filter row and
   pushed the document 19px past a 390px viewport.  Flex items do not shrink
   below their min-content width, so the chip wraps instead of overflowing. */
main .uflpa-controls>a.badge{max-width:100%;white-space:normal;overflow-wrap:anywhere;
  display:inline-flex;align-items:center;min-height:var(--tap-min)}
