/* Accessibility panel (fragments/a11y.html, js/a11y.js) and the display settings it applies.
   Loaded on every page, including the locked site. Controls are at least 44px and every
   boundary that identifies a control meets 3:1 contrast. */

/* Header button */
.prelaunch-actions, .header-actions { display:flex; align-items:center; gap:16px; }
/* The button keeps its visible name at every width, so voice control users can say it. */
@media (max-width:640px) {
  .prelaunch-actions { gap:10px; flex-wrap:wrap; justify-content:flex-end; }
  :is(.launch-header, .prelaunch-policy-header) { flex-wrap:wrap; row-gap:10px; }
}

/* Panel: a sheet on the right, full screen on phones */
.a11y-panel { position:fixed; inset:0 0 0 auto; width:min(420px,100vw); max-width:100vw; height:100dvh; max-height:100dvh; margin:0; padding:24px 24px 32px; border:0; border-left:1px solid #d6d6d3; background:#fff; color:#141414; overflow-y:auto; font-size:15px; line-height:1.55; }
.a11y-panel::backdrop { background:#14141466; }
.a11y-head { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.a11y-panel h2 { margin:0; font-size:24px; letter-spacing:-.03em; }
.a11y-close { display:inline-flex; align-items:center; justify-content:center; width:44px; height:44px; border:0; border-radius:50%; background:transparent; color:#141414; }
.a11y-close:hover { background:#f1f1ef; }
.a11y-group { margin-top:24px; padding-top:20px; border-top:1px solid #e1e1de; }
.a11y-group h3 { margin:0 0 6px; font-size:17px; letter-spacing:-.01em; }
.a11y-group > p { margin:0 0 14px; font-size:14px; line-height:1.55; color:#4d4d4d; }
.a11y-row { display:flex; flex-wrap:wrap; gap:8px; }
.a11y-btn { display:inline-flex; align-items:center; gap:8px; min-height:44px; padding:0 16px; border:1px solid #8a8a87; border-radius:999px; background:#fff; color:#141414; font-size:14px; font-weight:500; }
.a11y-btn:hover:not(:disabled) { border-color:#141414; }
.a11y-btn:disabled { color:#6b6b6b; border-color:#c9c9c6; cursor:not-allowed; }
.a11y-btn[hidden], .a11y-ico[hidden] { display:none; }
.a11y-btn .hc-svg { width:16px; height:16px; }
.a11y-ico { display:inline-flex; }
.a11y-btn-dark { background:#141414; border-color:#141414; color:#fff; }
.a11y-btn-dark:hover:not(:disabled) { background:#3a3a3a; border-color:#3a3a3a; }
.a11y-btn-dark:disabled { background:#d6d6d3; border-color:#d6d6d3; color:#4d4d4d; }
.a11y-status { margin:8px 0 0; font-size:13px; color:#3d3d3d; }
/* Kept in the page so its announcements are read, but takes no room until it has something to say. */
.a11y-status:empty { margin:0; }

/* Field labels: one small label above each choice or menu. */
.a11y-choice, .a11y-field { display:block; min-width:0; margin:18px 0 0; padding:0; border:0; }
.a11y-choice legend, .a11y-field > span:first-child { display:block; margin:0 0 6px; padding:0; font-size:13px; font-weight:500; color:#3d3d3d; }

/* Segmented choices (speed, text size): one outlined track, the chosen option filled. The native radios stay
   focusable under the labels. */
.a11y-seg { display:flex; gap:2px; padding:3px; border:1px solid #8a8a87; border-radius:12px; background:#fff; }
.a11y-seg label { position:relative; flex:1 1 0; min-width:0; display:flex; align-items:center; justify-content:center; min-height:38px; border-radius:9px; cursor:pointer; font-size:14px; font-weight:500; }
.a11y-seg label:hover:not(:has(input:checked)) { background:#f1f1ef; }
.a11y-seg input { position:absolute; inset:0; opacity:0; margin:0; cursor:pointer; }
.a11y-seg label:has(input:checked) { background:#141414; color:#fff; }
.a11y-seg label:has(input:focus-visible) { outline:3px solid #141414; outline-offset:2px; }

/* Menus: the native select, drawn with the same outline as the choices and a chevron that sits inside its padding. */
.a11y-select { position:relative; display:block; }
.a11y-select select { appearance:none; -webkit-appearance:none; display:block; width:100%; min-height:44px; margin:0; padding:0 42px 0 14px; border:1px solid #8a8a87; border-radius:12px; background:#fff; color:#141414; font:inherit; font-size:14px; font-weight:500; text-overflow:ellipsis; cursor:pointer; }
.a11y-select select:hover:not(:disabled) { border-color:#141414; }
.a11y-select select:focus-visible { outline:3px solid #141414; outline-offset:2px; }
.a11y-select select:disabled { color:#6b6b6b; cursor:not-allowed; }
.a11y-select .hc-svg { position:absolute; top:50%; right:14px; width:18px; height:18px; translate:0 -50%; pointer-events:none; }

/* Switches: native checkboxes with role="switch", so assistive technology reports on and off. Off is an
   outlined track with a small grey knob, on is a filled track with a white knob, both 3:1 or more. */
.a11y-switches { margin-top:10px; }
.a11y-switch { display:flex; align-items:center; justify-content:space-between; gap:16px; min-height:48px; cursor:pointer; font-size:15px; }
.a11y-switch input { order:2; flex:none; appearance:none; -webkit-appearance:none; position:relative; width:46px; height:28px; margin:0; border:2px solid #767673; border-radius:999px; background:#fff; cursor:pointer; transition:background-color .15s, border-color .15s; }
.a11y-switch input::before { content:""; position:absolute; top:4px; left:4px; width:16px; height:16px; border-radius:50%; background:#767673; transition:transform .15s, width .15s, height .15s, top .15s, left .15s; }
.a11y-switch input:checked { border-color:#141414; background:#141414; }
.a11y-switch input:checked::before { top:2px; left:2px; width:20px; height:20px; background:#fff; transform:translateX(18px); }
.a11y-switch input:focus-visible { outline:3px solid #141414; outline-offset:3px; }
.a11y-hint { margin:12px 0 0; font-size:13px; line-height:1.5; color:#4d4d4d; }
.a11y-foot { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:24px; padding-top:20px; border-top:1px solid #e1e1de; }
.a11y-foot a { font-size:14px; text-decoration:underline; text-underline-offset:3px; }
.a11y-note { margin:12px 0 0; font-size:12px; color:#4d4d4d; }

/* Read aloud: the passage being read, and the small player shown while the panel is closed */
.a11y-reading { background:#fff1b8 !important; color:#141414 !important; outline:3px solid #8a6500; outline-offset:4px; border-radius:4px; }
.a11y-reader { position:fixed; left:16px; bottom:16px; z-index:95; display:flex; align-items:center; gap:8px; padding:6px 6px 6px 16px; border-radius:999px; background:#141414; color:#fff; box-shadow:0 8px 24px #00000033; font-size:14px; }
.a11y-reader[hidden] { display:none; }
.a11y-reader .a11y-btn { min-height:40px; border-color:#ffffff8c; background:transparent; color:#fff; }
.a11y-reader .a11y-btn:hover { border-color:#fff; }
.a11y-reader .a11y-btn:focus-visible { outline-color:#fff; }

/* On-screen keyboard, docked to the bottom. The page keeps room for it so it never hides focus. */
html.osk-open { scroll-padding-bottom:calc(var(--osk-height, 320px) + 16px); }
html.osk-open body { padding-bottom:var(--osk-height, 320px); }
html.osk-open .a11y-reader { bottom:calc(var(--osk-height, 320px) + 16px); }
/* While the read-aloud player shows, the page keeps room below its last line, so the player never covers
   a link or the focused control (WCAG 2.4.11). */
html.a11y-reader-on { scroll-padding-bottom:88px; }
html.a11y-reader-on body { padding-bottom:76px; }
html.osk-open.a11y-reader-on { scroll-padding-bottom:calc(var(--osk-height, 320px) + 88px); }
html.osk-open.a11y-reader-on body { padding-bottom:calc(var(--osk-height, 320px) + 76px); }
/* The on-screen keyboard: a centred tray of soft keys, letters on white and function keys a shade darker.
   On a page with no text box the keys rest until one appears; Hide always works. */
.osk { position:fixed; left:0; right:0; bottom:0; z-index:90; padding:12px max(8px, calc((100vw - 760px) / 2)); border-top:1px solid #d6d6d3; background:#e6e6e3; box-shadow:0 -6px 20px #0000000f; }
.osk[hidden] { display:none; }
.osk-row { display:flex; gap:6px; margin-top:6px; }
.osk-row:first-of-type { margin-top:0; }
.osk-key { flex:1 1 0; min-width:0; min-height:44px; padding:0 2px; border:0; border-radius:7px; background:#fff; color:#141414; font-size:19px; line-height:1; box-shadow:0 1px 0 #00000033; cursor:pointer; }
.osk-key:hover { background:#f7f7f5; }
.osk-key:active { background:#d9d9d5; }
.osk-key:focus-visible { outline:3px solid #141414; outline-offset:2px; }
.osk-wide, .osk-space { background:#cfcfcb; font-size:14px; }
.osk-wide:hover, .osk-space:hover { background:#c4c4c0; }
.osk-key[aria-pressed="true"] { background:#141414; color:#fff; }
.osk-key:disabled { background:#efefec; color:#767673; box-shadow:none; cursor:default; }
.osk-wide { flex-grow:1.8; }
.osk-space { flex-grow:6; }
@media (max-width:640px) {
  .osk { padding:8px 4px; }
  .osk-row { gap:4px; margin-top:5px; }
  .osk-key { min-height:44px; padding:0; font-size:17px; border-radius:6px; }
  .osk-wide { flex-grow:2.2; font-size:12px; }
  .osk-space { font-size:12px; }
}

/* Display settings, set on <html> by a11y-init.js */
/* Larger text scales each block of text, not the layout, so columns still fit the screen. */
html[data-text-size="125"] :is(p, li, dt, dd, td, th, label, legend, summary, figcaption, blockquote, h3, h4, a, button, input, select, small, time):not(:is(p, li, dt, dd, td, th, label, legend, summary, figcaption, blockquote, h3, h4, a, button) *):not(header *, .a11y-panel *, .osk *, .a11y-reader *) { zoom:1.25; }
html[data-text-size="150"] :is(p, li, dt, dd, td, th, label, legend, summary, figcaption, blockquote, h3, h4, a, button, input, select, small, time):not(:is(p, li, dt, dd, td, th, label, legend, summary, figcaption, blockquote, h3, h4, a, button) *):not(header *, .a11y-panel *, .osk *, .a11y-reader *) { zoom:1.5; }
html[data-text-size] :is(p, li, td, a, span, h1, h2, h3, h4) { overflow-wrap:anywhere; }
/* Larger or wider text may need two lines in a button. */
html:is([data-text-size], [data-spacing]) :is(.hc-button, .pg-button, .hc-chips a, .hc-topic-chips a) { white-space:normal; height:auto; min-height:44px; padding-block:8px; }
/* Two-row header: logo and actions on top, navigation below. Phones always use it, since the
   logo, navigation and actions do not fit one row; larger or wider text needs it up to 700px. */
@media (max-width:520px) {
  .self-serve .header { height:auto; grid-template-columns:minmax(0,1fr) auto; grid-template-areas:"brand login" "nav nav"; row-gap:2px; padding-block:14px 8px; }
  .self-serve .header > .brand { grid-area:brand; }
  .self-serve .main-nav { grid-area:nav; justify-self:start; flex-wrap:wrap; }
  .self-serve .header-actions { display:contents; }
  .self-serve .header .login-link { grid-area:login; justify-self:end; }
}
@media (max-width:700px) {
  html:is([data-text-size], [data-spacing]) .self-serve .header { height:auto; grid-template-columns:minmax(0,1fr) auto; grid-template-areas:"brand login" "nav nav"; row-gap:2px; padding-block:14px 8px; }
  html:is([data-text-size], [data-spacing]) .self-serve .header > .brand { grid-area:brand; }
  html:is([data-text-size], [data-spacing]) .self-serve .main-nav { grid-area:nav; justify-self:start; flex-wrap:wrap; }
  html:is([data-text-size], [data-spacing]) .self-serve .header-actions { display:contents; }
  html:is([data-text-size], [data-spacing]) .self-serve .header .login-link { grid-area:login; justify-self:end; }
  html:is([data-text-size], [data-spacing]) :is(.launch-header, .prelaunch-policy-header) { flex-wrap:wrap; }
}

/* High contrast: black text on white, dark surfaces turned light, every border solid black. */
html[data-contrast="high"] { --muted:#000; --ink:#000; --hc-quiet:#000; --hc-body:#000; --hc-line:#000; --pg-quiet:#000; --pg-body:#000; --pg-line:#000; }
html[data-contrast="high"] body, html[data-contrast="high"] body :not(img, picture, canvas, video) { color:#000 !important; }
html[data-contrast="high"] :is(.hc-news, .hc-news-list a, .pg-dark, .hc-icon-badge, .pg-icon, .pg-button-dark, .hc-search button, .hc-pill, .hc-tag, .pg-tag, .pg-tag-feature, .oean-hero-action, .a11y-btn-dark, .a11y-reader, .a11y-reader .a11y-btn, .hc-doc-nav a[aria-current], .osk-key[aria-pressed="true"], .a11y-seg label:has(input:checked)) { background:#fff !important; border:2px solid #000 !important; }
html[data-contrast="high"] :is(.hc-topic, .hc-guide, .hc-path img, .pg-card, .pg-table-wrap, .hc-search, .hc-chips a, .hc-topic-chips a, .pg-button, .hc-button, .a11y-btn, .osk-key, .hc-pager a, .ct-copy, .pg-note-card, .hc-links li, .pg-sitemap > li) { border:2px solid #000 !important; }
html[data-contrast="high"] .pg-steps li::before { background:#fff !important; color:#000 !important; border:2px solid #000; }
html[data-contrast="high"] .a11y-switch input { background:#fff; border-color:#000; }
html[data-contrast="high"] .a11y-switch input::before { background:#000; }
html[data-contrast="high"] .a11y-switch input:checked { background:#000; }
html[data-contrast="high"] :is(.a11y-seg, .a11y-select select) { border:2px solid #000; }
html[data-contrast="high"] .a11y-switch input:checked::before { background:#fff; }
html[data-contrast="high"] ::placeholder { color:#000; opacity:1; }
html[data-contrast="high"] a { text-decoration:underline; text-underline-offset:3px; }
/* Coming soon: drop the dark animated landscape and the dark footer strip, so black text sits on white. */
html[data-contrast="high"] :is(.launch-page, .launch-header, .launch-page .footer.site-footer) { background:#fff !important; border-color:#000 !important; }
html[data-contrast="high"] .launch-art { display:none !important; }
html[data-contrast="high"] .launch-header .brand img { filter:none; }

/* Underline links */
html[data-links="underline"] a { text-decoration:underline !important; text-decoration-thickness:1px !important; text-underline-offset:3px !important; }

/* Wider text spacing: the values in WCAG 1.4.12 Text Spacing. */
html[data-spacing="readable"] body :is(p, li, dt, dd, td, th, label, legend, span, a, h1, h2, h3, h4, summary, figcaption, button, time, small):not(.osk *, .a11y-reader *) { line-height:1.8 !important; letter-spacing:.12em !important; word-spacing:.16em !important; }
html[data-spacing="readable"] main p { margin-bottom:2em !important; }
html[data-spacing="readable"] body :is(p, li, td, a, span, h1, h2, h3, h4) { overflow-wrap:anywhere; }

/* Stronger focus outline: thick blue with a white ring, visible on light and dark surfaces. */
html[data-focus="strong"] :focus-visible { outline:4px solid #1d4ed8 !important; outline-offset:3px !important; box-shadow:0 0 0 8px #fff !important; }

/* Color filters for color blindness (the SVG filters sit beside the panel in fragments/a11y.html). They go on <html>,
   the one element whose filter leaves fixed and sticky parts of the page where they are. */
.a11y-filters { position:absolute; width:0; height:0; overflow:hidden; }
html[data-color-filter="protanopia"] { filter:url(#a11y-protanopia); }
html[data-color-filter="deuteranopia"] { filter:url(#a11y-deuteranopia); }
html[data-color-filter="tritanopia"] { filter:url(#a11y-tritanopia); }
html[data-color-filter="grayscale"] { filter:grayscale(1); }

/* Reduce motion: no animation, transition or smooth scrolling anywhere. */
html[data-reduce-motion="true"] *, html[data-reduce-motion="true"] *::before, html[data-reduce-motion="true"] *::after { animation-duration:0s !important; animation-iteration-count:1 !important; transition:none !important; scroll-behavior:auto !important; }
