/* Accessibility helpers shared by every layout (wave 3, B1, 5 Nov 2026).
   The Tailwind bundle is a manual npm build that is not rebuilt for small fixes (DEPLOYMENT.md), so the few things
   the machine check asked for that the bundle cannot do live here, linked after tailwind.min.css in each layout.
   Plain CSS, no tokens of its own: colours come from the theme variables where there is a theme. */

/* Skip to content (B1-3). Off screen until it takes keyboard focus, then a white button with dark ink (17:1) and a green
   edge, above the SOS banner (z-index 3000). The old Tailwind classes (focus:bg-accent, focus:text-gray-950) are not in
   the bundle, so on the dark control-room windows it showed dark text on a dark page (1.18:1). */
.sh-skip { position: fixed; left: 8px; top: -96px; z-index: 5000; display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px;
           border-radius: 8px; background: #ffffff; color: #0f172a; border: 2px solid #047857; font: 700 14px/1.2 system-ui, -apple-system, "Segoe UI", sans-serif;
           text-decoration: none; box-shadow: 0 4px 14px rgba(0, 0, 0, .35); }
.sh-skip:focus { top: 8px; outline: 3px solid #0f172a; outline-offset: 2px; }
#main-content:focus, #main:focus { outline: none; }

/* Text smaller than 12px (B1-4). 394 places in the views set text-[10px] or text-[11px] (menu group headings, the company
   chip, hints, badges). One rule lifts them all to the 12px that text-xs is, instead of editing each one. */
.text-\[10px\], .text-\[11px\] { font-size: 12px; line-height: 1rem; }

/* A phone-sized tap target (B1-5). WCAG 2.2 asks 24px, a thumb reliably hits 44px. Inline links and the small back
   arrows get the room on phones only; desktop layouts are untouched. */
@media (max-width: 767.98px) {
    .sh-tap { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }
    .sh-tapfield { min-height: 44px; }
    /* The "Free tools / ..." trail on the public tool pages. */
    .pt-crumb a { display: inline-flex; align-items: center; min-height: 44px; }
    /* A breadcrumb or a row of footer links: every link in it is a target. */
    .sh-taps a { display: inline-flex; align-items: center; min-height: 44px; }
    /* A <summary> keeps its marker only while it stays a list item, so it gets room by padding, not by flex. */
    .sh-tapsum { min-height: 44px; padding-top: 10px; padding-bottom: 10px; box-sizing: border-box; }
    /* Leaflet's attribution line and zoom links are tiny by design; keep them readable and hittable on a phone. */
    .leaflet-control-attribution a { display: inline-block; padding: 12px 2px; }
    .leaflet-control-attribution { font-size: 12px !important; }
}

/* Wide tables inside a card (B1-11, 5 Nov 2026): a card with overflow-hidden that holds a table cut the table's right-hand columns
   off on a phone (Sites, Invoices, Payments, People, Debit orders, SOP templates ...). The card now scrolls sideways instead. Its rounded
   corners still clip, and a card without a table is untouched. */
main .overflow-hidden:has(table) { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* A table is the box that anything placed absolutely inside it belongs to (role walk finish, 28 Nov 2026). A hidden label for
   screen readers (.sr-only is position:absolute) inside a table that scrolls sideways belonged to the page instead, so it sat
   where the cut-off part of the table would have been and made the whole page wider than the phone: Company users by 60 px and
   Listing claims by 170 px for a platform administrator, whose extra columns carry such labels. With this the label stays inside
   the table's own scrolling box and the page keeps the width of the screen. */
main table { position: relative; }

/* Text links on the public pages and in the control-room windows, on a phone (launch small items, 29 Nov 2026).
   The role walk's tap rules (the end of sh-simple.css) reach only the signed-in pages: that stylesheet is not loaded by the public layout
   or by the control-room windows (the video wall, the comms window, the event stack), whose main box is #main and not #main-content.
   So a plain text link there kept its 16 to 19 px height ("support@...", "Open in the main app", a name in a list). The same rule,
   scoped to those two layouts: a text link gets 5 px of room above and below. On a link inside a line of text this changes no layout,
   it only makes the box a finger can hit 24 px or more. A link that carries its own padding, or is drawn as a block, a button or a
   card, is left alone and gets a 24 px floor instead where it is smaller. Phones only. */
@media (max-width: 767.98px) {
    body.pub-soft a:not([class]),
    body.pub-soft a.underline:not([class*="p-"]):not([class*="px-"]):not([class*="py-"]):not([class*="pt-"]):not([class*="pb-"]):not(.block):not(.flex):not(.inline-flex):not(.inline-block):not(.grid):not(.sh-tap),
    body.pub-soft a[class*="hover:underline"]:not([class*="p-"]):not([class*="px-"]):not([class*="py-"]):not([class*="pt-"]):not([class*="pb-"]):not(.block):not(.flex):not(.inline-flex):not(.inline-block):not(.grid):not(.sh-tap),
    body.pub-soft a[class*="text-emerald-"]:not([class*="p-"]):not([class*="px-"]):not([class*="py-"]):not([class*="pt-"]):not([class*="pb-"]):not(.block):not(.flex):not(.inline-flex):not(.inline-block):not(.grid):not(.sh-tap),
    body.pub-soft a[class*="text-gray-"]:not([class*="p-"]):not([class*="px-"]):not([class*="py-"]):not([class*="pt-"]):not([class*="pb-"]):not(.block):not(.flex):not(.inline-flex):not(.inline-block):not(.grid):not(.sh-tap),
    #main a:not([class]),
    #main a.underline:not([class*="p-"]):not([class*="px-"]):not([class*="py-"]):not([class*="pt-"]):not([class*="pb-"]):not(.block):not(.flex):not(.inline-flex):not(.inline-block):not(.grid):not(.sh-tap),
    #main a[class*="text-brand-"]:not([class*="p-"]):not([class*="px-"]):not([class*="py-"]):not([class*="pt-"]):not([class*="pb-"]):not(.block):not(.flex):not(.inline-flex):not(.inline-block):not(.grid):not(.sh-tap),
    #main a[class*="text-content-"]:not([class*="p-"]):not([class*="px-"]):not([class*="py-"]):not([class*="pt-"]):not([class*="pb-"]):not(.block):not(.flex):not(.inline-flex):not(.inline-block):not(.grid):not(.sh-tap) {
        padding-top: 5px; padding-bottom: 5px;
    }
    body.pub-soft a.block[class*="text-emerald-"], body.pub-soft a.inline-block[class*="text-emerald-"], body.pub-soft a.inline-flex[class*="text-emerald-"],
    body.pub-soft a.inline-block[class*="text-gray-"], body.pub-soft a.inline-flex[class*="text-gray-"],
    #main a.block[class*="text-brand-"], #main a.inline-block[class*="text-brand-"], #main a.inline-block[class*="text-content-"],
    #main a.inline-flex[class*="text-brand-"], #main a.inline-flex[class*="text-content-"] { min-height: 24px; }
    /* A word-sized button in a control-room window is never narrower than 24 px; a fold-out heading there gets the same floor. */
    #main button:not([role=switch]):not(.sh-inline) { min-width: 24px; }
    #main summary { min-height: 24px; }
}
