/* Shared, optional display preferences. These support the semantic page structure;
   they are not a substitute for accessible content, keyboard flows or testing. */
.a11y-skip { position: fixed; z-index: 1002; inset-block-start: 8px; inset-inline-start: 8px; padding: 12px 18px; border-radius: 14px; background: #fff; color: #252525; border: 2px solid #3d4785; font: 700 18px/1.4 var(--font-sans, system-ui, sans-serif); transform: translateY(-180%); }
.a11y-skip:focus { transform: none; }
.a11y-toolbar { width: min(100%, 600px); margin-inline: auto; padding: 6px 16px 0; display: flex; justify-content: flex-start; }
.a11y-open { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 7px 12px; border: 1px solid var(--line, #958a83); border-radius: 999px; background: var(--raised, #fff); color: var(--ink, #2d2926); font: 600 14px/1.4 var(--font-sans, system-ui, sans-serif); cursor: pointer; }
.a11y-open svg { width: 20px; height: 20px; flex: none; }
.a11y-dialog { width: min(100% - 32px, 480px); max-height: calc(100dvh - 32px); overflow: auto; padding: 24px; border: 1px solid var(--line, #958a83); border-radius: 24px; background: var(--ground, #f9f4f2); color: var(--ink, #2d2926); box-shadow: 0 20px 60px #0003; font: 400 18px/1.5 var(--font-sans, system-ui, sans-serif); }
.a11y-dialog::backdrop { background: #2d292680; }
.a11y-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.a11y-dialog h2 { margin: 0; font-size: 26px; line-height: 1.25; }
.a11y-dialog h2:focus { outline: none; }
.a11y-close { flex: none; width: 44px; height: 44px; border: 1px solid var(--line, #958a83); border-radius: 50%; background: var(--raised, #fff); color: var(--ink, #2d2926); font: 400 28px/1 var(--font-sans, system-ui, sans-serif); cursor: pointer; }
.a11y-description { margin: 12px 0 20px; font-size: 16px; }
.a11y-field { display: grid; gap: 8px; margin: 16px 0; font-size: 18px; }
.a11y-field select { width: 100%; min-height: 48px; padding: 10px 12px; border: 1.5px solid var(--line, #958a83); border-radius: 13px; color: var(--ink, #2d2926); background: var(--raised, #fff); font: inherit; }
.a11y-choice { display: flex; align-items: flex-start; gap: 12px; padding: 12px; min-height: 48px; margin: 12px 0; border: 1px solid var(--line, #958a83); border-radius: 14px; background: var(--raised, #fff); font: inherit; cursor: pointer; }
.a11y-choice input { width: 24px; height: 24px; margin: 1px 0 0; flex: none; accent-color: var(--action, #3d4785); }
.a11y-dialog-actions { display: grid; gap: 10px; margin-top: 20px; }
.a11y-reset, .a11y-done { width: 100%; min-height: 48px; padding: 10px 16px; border-radius: 999px; border: 1.5px solid var(--action, #3d4785); background: var(--raised, #fff); color: var(--action, #3d4785); font: 700 18px/1.35 var(--font-sans, system-ui, sans-serif); cursor: pointer; }
.a11y-done { background: var(--action, #3d4785); color: var(--on-action, #fff); }
.a11y-help { display: inline-block; min-height: 44px; padding-block: 10px; margin-top: 8px; color: var(--action, #3d4785); font-size: 16px; }
.a11y-feedback { margin: 8px 0 0; min-height: 1.5em; font-size: 15px; }
.a11y-toolbar :focus-visible, .a11y-dialog :focus-visible { outline: 3px solid var(--focus, #b4450f); outline-offset: 3px; }
/* The bases are measured from the unmodified design, so nested text is scaled
   once, not once per ancestor. New async content receives the same treatment. */
html[data-a11y-text=large] { --a11y-text-scale: 1.2; }
html[data-a11y-text=larger] { --a11y-text-scale: 1.4; }
html[data-a11y-text=largest] { --a11y-text-scale: 2; }
html[data-a11y-text] .a11y-scaled { font-size: calc(var(--a11y-base-font) * var(--a11y-text-scale)) !important; }
html[data-a11y-text] :is(main, .wrap, .screen-scroll, .card, .panel, .row-text, .player-meta) { min-width: 0; overflow-wrap: anywhere; }
html[data-a11y-text] .appframe { height: auto; min-height: 100dvh; overflow: visible; margin-block: 0; }
html[data-a11y-text] .screen-scroll { overflow: visible; }
html[data-a11y-text] .tabbar { position: sticky; flex: none; margin-top: auto; }
html[data-a11y-text] :is(.app-header, .player-tools, .rec-actions, .keep-actions) { height: auto; }
html[data-a11y-text] .app-header { grid-template-columns: auto minmax(0, 1fr) auto; }
html[data-a11y-text] :is(.btn, .tab, .row, .chapter, .chip span, .sync, .from) { height: auto; white-space: normal; }
html[data-a11y-text] .from { overflow: visible; }
html[data-a11y-text] .panel > .btn.wide { position: static; }
html[data-a11y-text] .life-phone { min-height: 0; }
html[data-a11y-text] .life-phone .focus { min-height: 0; }
html[data-a11y-text] .a11y-dialog { max-height: calc(100dvh - 24px); }
html[data-a11y-contrast] { --ground: #fff; --raised: #fff; --tint: #f7eee6; --ink: #111; --ink-soft: #222; --ink-faint: #333; --line: #555; --line-soft: #767676; --action: #252f69; --on-action: #fff; --focus: #9c3000; --brand-text-color: #111; }
html[data-a11y-contrast] :is(input, select, textarea, button, .card, .row, .player, .tabbar-glass) { border-color: #555; }
html[data-a11y-contrast] .tabbar-glass { background: #fff; backdrop-filter: none; -webkit-backdrop-filter: none; border: 1px solid #555; }
html[data-a11y-motion] *, html[data-a11y-motion] *::before, html[data-a11y-motion] *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
@media (max-width: 400px) { html[data-a11y-text] :is(.shelves, .decades, .rec-actions, .keep-actions, .player-tools) { grid-template-columns: 1fr; } html[data-a11y-text] .rec-actions > * { grid-column: auto; } .a11y-dialog { padding: 18px; } }
@media (forced-colors: active) { .a11y-open, .a11y-close, .a11y-choice, .a11y-done, .a11y-reset, .a11y-dialog { border: 2px solid ButtonText; } }
@media print { .a11y-toolbar, .a11y-dialog, .a11y-skip { display: none !important; } }
/* Keep the visible keyboard skip link opposite the display-menu trigger. */
.a11y-skip { inset-inline-start:auto; inset-inline-end:8px; }
