/* Shared accessibility and touch rules for every interface (the v1 shell, the sign-in pages, the platform console,
   the consultant and guest portals and the older pages built on base.html). Loaded after each page's own styles.
   Built from the Web Interface Guidelines: a visible keyboard focus, no double-tap zoom delay, scrolling that stays
   inside a drawer, and less motion for people who ask their system for it. Colours come from tokens.css; a page that
   does not load tokens.css falls back to the system colours. */

/* keyboard focus: one visible ring for everything that can take focus. :where() keeps it at zero specificity, so a
   component that draws its own ring keeps it. */
:where(a,button,summary,[role=button],[role=menuitem],[role=tab],[role=option],[tabindex]):focus-visible{outline:2px solid var(--info,Highlight);outline-offset:2px}
:where(input,select,textarea,[contenteditable=true],[contenteditable=""]):focus-visible{outline:2px solid var(--info,Highlight);outline-offset:1px}
/* composite boxes whose inner field draws no ring of its own */
:where(.global-search,.v98-psearch,.business-url-builder,.attdev-search):focus-within{outline:2px solid var(--info,Highlight);outline-offset:1px}
/* a table row that opens a record (made focusable by a11y.js) */
tr[data-ob-row]:focus-visible{outline:2px solid var(--info,Highlight);outline-offset:-2px}

/* skip to the page content: hidden until it receives keyboard focus */
.ob-skip{position:fixed;inset-inline-start:12px;top:-80px;z-index:2147483000;padding:10px 16px;border-radius:var(--r-md,10px);background:var(--surface,Canvas);color:var(--ink,CanvasText);font-weight:700;text-decoration:none;box-shadow:var(--shadow,0 2px 10px rgba(0,0,0,.25));transition:top .15s}
.ob-skip:focus{top:calc(12px + env(safe-area-inset-top,0px))}
:where(main,#content,.content)[tabindex="-1"]:focus{outline:none}

/* touch: no 300 ms double-tap delay, and a quiet press colour instead of the default grey flash */
html{-webkit-tap-highlight-color:color-mix(in srgb,var(--info,Highlight) 18%,transparent)}
:where(a,button,summary,label,input,select,textarea,[role=button],[role=menuitem],[role=tab]){touch-action:manipulation}

/* drawers, dialogs and menus: scrolling inside them does not scroll the page behind */
:where(.drawer,.drawer-body,.palette-box,.palette-list,.ob-ask-box,.um-panel,.modal,.modal-body,[role=dialog],[role=alertdialog],[role=menu],[role=listbox]){overscroll-behavior:contain}

/* headings wrap without a lonely last word; anchors land below the sticky top bar */
:where(h1,h2,h3){text-wrap:balance}
:where(p,li,dd,figcaption){text-wrap:pretty}
:where(h1,h2,h3,h4,h5,h6,[id]):target{scroll-margin-top:80px}

/* native select in dark mode on Windows: explicit colours (zero specificity, so styled selects keep theirs) */
:where(select){background-color:var(--surface,Field);color:var(--ink,FieldText)}

/* numbers that are compared line by line keep their columns */
:where(td.amt,th.amt,td.num,.amt,.money){font-variant-numeric:tabular-nums}

/* long words and pasted links do not push a cell or card wider than the screen */
:where(.card,.drawer-body,.toast,.ob-ask-box){overflow-wrap:break-word}

/* less motion when the system asks for it */
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}
}
