/* Power-ups (v2/powerups.js; docs/platform/ACCESSIBILITY-POWER-UPS.md part a): the top-bar button and panel, and the
   classes and variables it sets on <html>. Every course gets them; nothing here is per course. */

/* The button: the same size and look as the Go to button beside it. */
.pu { position: relative; display: flex; align-items: center; }
.pu-open { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; min-width: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); cursor: pointer; font: inherit; font-weight: 600; font-size: .95rem; }
.pu-open svg { width: 18px; height: 18px; }
.pu-open[aria-expanded="true"] { background: var(--sky-soft); }
.pu-open:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
@media (max-width: 1699px) {
  .pu-open-text { display: none; }
  .pu-open { padding: 0; width: 44px; }
}
@media (max-width: 1699px) and (pointer: fine) { .pu-open { width: 34px; min-width: 34px; min-height: 34px; height: 34px; } }

/* The panel: small, beside the button, never modal. */
.pu-panel { position: absolute; right: 0; top: calc(100% + 8px); width: min(380px, calc(100vw - 32px)); max-height: calc(100vh - 90px); overflow-y: auto; background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(11,31,58,.18); padding: 12px 16px 14px; z-index: 60; text-align: left; }
.pu-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pu-head h2 { font-size: 1.15rem; margin: 0; }
.pu-x { border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 1.1rem; min-width: 44px; min-height: 44px; border-radius: 8px; cursor: pointer; }
.pu-x:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.pu-intro { color: var(--muted); margin: 2px 0 8px; }
.pu-group { border: 0; border-top: 1px solid var(--line); margin: 0; padding: 10px 0 8px; }
.pu-group legend { font-weight: 700; padding: 0; margin-bottom: 6px; float: left; width: 100%; }
.pu-opts { clear: both; display: flex; flex-wrap: wrap; gap: 6px; }
.pu-opt { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 4px 12px 4px 8px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
.pu-opt:has(input:checked) { border-color: var(--navy); background: var(--sky-soft); font-weight: 600; }
.pu-opt input { width: 18px; height: 18px; margin: 0; accent-color: var(--navy); }
.pu-opt input:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.pu-hint { color: var(--muted); margin: 6px 0 0; }
.pu-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px; }
.pu-where { color: var(--muted); margin: 0; flex: 1 1 160px; }
.pu-more:empty { display: none; }
@media (max-width: 760px) {
  .pu { position: static; }
  .pu-panel { position: fixed; left: 16px; right: 16px; top: 64px; width: auto; }
}

/* Text size: the root font size, so rem and em text grows and the page reflows. */
html.pu-text { font-size: var(--pu-text, 100%); }
html.pu-text body { font-size: 1rem; }
html.pu-text #app { overflow-wrap: break-word; }

/* High contrast: dark text on white, stronger borders, no pale greys. */
html.pu-high { --ink: #000; --muted: #1f2937; --line: #4b5563; --bg: #fff; --teal-dark: #00546b; --sky-soft: #d7eef6; }
html.pu-high body { background: #fff; }
html.pu-high .muted, html.pu-high .small.muted { color: #1f2937 !important; }
html.pu-high .card, html.pu-high .btn, html.pu-high input, html.pu-high select, html.pu-high textarea { border-color: #4b5563; }
html.pu-high #app a:not(.btn) { text-decoration: underline; }

/* Dark: the whole page turned dark with its colours kept. Only real photos and video are turned back, so they look as
   they are; drawings (SVG), the logo and math stay with the page, light on dark. A picture is turned back once: the
   image inside it isn't turned again. */
html.pu-dark { filter: invert(1) hue-rotate(180deg); background: #fff; }
html.pu-dark :is(video, picture, img:not([src$=".svg"]):not([src*=".svg?"]):not([src^="data:image/svg"]):not(.brand-logo)) { filter: invert(1) hue-rotate(180deg); }
html.pu-dark picture img { filter: none; }

/* Easier-to-read font, with more letter, word and line spacing. */
html.pu-easy { --text: "Atkinson Hyperlegible", system-ui, sans-serif; --display: "Atkinson Hyperlegible", system-ui, sans-serif; }
html.pu-easy body { letter-spacing: .02em; word-spacing: .08em; line-height: 1.75; }

/* Less motion, On: nothing moves (the coach is stilled in JS, app.js syncCoach). */
html.pu-still *, html.pu-still *::before, html.pu-still *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: .001ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; }

/* The reading line: a guide band, or a mask that dims all but the lines being read. It never takes a click. */
html.pu-panel-open .pu-line-part { display: none; }
.pu-line-part { position: fixed; left: 0; right: 0; pointer-events: none; z-index: 1050; }
.pu-line-guide { background: rgba(255, 214, 10, .2); border-top: 2px solid rgba(1, 26, 68, .6); border-bottom: 2px solid rgba(1, 26, 68, .6); }
.pu-line-mask { background: transparent; border-top: 2px solid rgba(255, 214, 10, .9); border-bottom: 2px solid rgba(255, 214, 10, .9); }
#pu-mask-top { top: 0; background: rgba(1, 26, 68, .55); }
#pu-mask-bot { bottom: 0; background: rgba(1, 26, 68, .55); }
/* Under Dark the page is inverted, these with it: colours chosen so that after the inversion the mask dims (dark) and
   the guide stays a soft yellow band with light edges. */
html.pu-dark .pu-line-guide { background: rgba(110, 92, 0, .35); border-top-color: rgba(0, 0, 0, .85); border-bottom-color: rgba(0, 0, 0, .85); }
html.pu-dark .pu-line-mask { border-top-color: rgba(110, 92, 0, .95); border-bottom-color: rgba(110, 92, 0, .95); }
html.pu-dark #pu-mask-top, html.pu-dark #pu-mask-bot { background: rgba(255, 255, 255, .6); }
@media print { .pu, .pu-line-part { display: none !important; } }
