/* Достъпност: панелът с настройките и режимите, които включва a11y.js (класове a11y-* на <html>). */

/* Прескачане към съдържанието: вижда се само при Tab */
.skip-link { position: fixed; left: 12px; top: -80px; z-index: 1000; padding: 12px 18px; border-radius: 12px; background: #f5c451; color: #1a1405 !important; font-weight: 800; text-decoration: none; transition: top .15s; }
.skip-link:focus { top: 12px; outline: 3px solid #fff; outline-offset: 2px; }

/* Бутон в горната лента */
.a11y-btn { flex: none; display: inline-grid; place-items: center; width: 46px; height: 46px; padding: 0; border-radius: 14px; border: 1px solid var(--line, rgba(255, 255, 255, .12)); background: var(--card, rgba(255, 255, 255, .05)); color: var(--text, #f4f1ea); cursor: pointer; transition: background .2s, border-color .2s, transform .2s; }
.a11y-btn:hover { background: var(--card-2, rgba(255, 255, 255, .1)); border-color: rgba(245, 196, 81, .5); }
.au-tool.a11y-btn { width: 36px; height: 36px; border-radius: 10px; }
/* Телефон: пет бутона в горната лента без хоризонтално превъртане */
@media (max-width: 600px) {
  .nav { gap: 7px !important; }
  .nav :is(.a11y-btn, .cart-btn) { width: 42px; height: 42px; }
  .nav .account-btn { height: 42px; padding: 0 9px; }
  .nav .lang-menu summary { padding: 8px 9px; }
}
@media (max-width: 440px) { .nav .brand > span { display: none; } }
.au-tool.a11y-btn svg { width: 19px; height: 19px; }

/* Панел */
.a11y-panel {
  width: min(440px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); margin: 12px 12px auto auto; padding: 0; overflow: auto;
  border: 1px solid rgba(245, 196, 81, .35); border-radius: 20px; background: #15121f; color: #f4f1ea;
  font-family: "Manrope", system-ui, sans-serif; font-size: 15px; line-height: 1.45; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .85);
}
.a11y-panel::backdrop { background: rgba(5, 4, 10, .55); }
.a11y-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 10px; background: #15121f; }
.a11y-head h2 { margin: 0; font-size: 20px; font-family: "Unbounded", "Manrope", system-ui, sans-serif; }
.a11y-x { width: 40px; height: 40px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .15); background: rgba(255, 255, 255, .06); color: inherit; font-size: 16px; cursor: pointer; }
.a11y-intro { margin: 0 18px 12px; color: #c9c4d6; font-size: 14px; }
.a11y-sec { margin: 0 12px 12px; padding: 12px; border-radius: 16px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .08); }
.a11y-sec h3 { margin: 2px 4px 10px; font-size: 15px; }
.a11y-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.a11y-sw { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .04); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.a11y-sw:hover { border-color: rgba(245, 196, 81, .5); }
.a11y-sw[aria-checked="true"] { border-color: #f5c451; background: rgba(245, 196, 81, .12); }
.a11y-knob { position: relative; flex: none; width: 40px; height: 24px; border-radius: 99px; background: rgba(255, 255, 255, .2); transition: background .2s; }
.a11y-knob::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; }
.a11y-sw[aria-checked="true"] .a11y-knob { background: #f5c451; }
.a11y-sw[aria-checked="true"] .a11y-knob::after { transform: translateX(16px); background: #1a1405; }
.a11y-sw-text { display: grid; gap: 2px; }
.a11y-sw-text b { font-weight: 700; }
.a11y-sw-text small { color: #c9c4d6; font-size: 13px; }
.a11y-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.a11y-act { min-height: 42px; padding: 0 14px; border-radius: 12px; border: 1px solid #f5c451; background: #f5c451; color: #1a1405; font: 700 14px/1 "Manrope", system-ui, sans-serif; cursor: pointer; }
.a11y-act:disabled { opacity: .45; cursor: not-allowed; }
.a11y-act[aria-pressed="true"] { background: #fff; border-color: #fff; }
.a11y-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 3px; border-radius: 12px; background: rgba(0, 0, 0, .3); }
.a11y-seg button { min-height: 36px; padding: 0 11px; border: 0; border-radius: 9px; background: none; color: #c9c4d6; font: 600 13px "Manrope", system-ui, sans-serif; cursor: pointer; }
.a11y-seg button[aria-pressed="true"] { background: #f5c451; color: #1a1405; }
.a11y-sizes { display: grid; grid-template-columns: repeat(4, 1fr); width: 100%; }
.a11y-sizes button { display: grid; justify-items: center; gap: 2px; padding: 6px 0; min-height: 54px; }
.a11y-sizes span { font-weight: 800; line-height: 1; }
.a11y-sizes small { font-size: 11px; }
.a11y-warn { margin: 10px 4px 0; color: #ffb4b4; font-size: 13px; }
.a11y-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 4px 18px 18px; }
.a11y-reset { background: none; color: #f4f1ea; border-color: rgba(255, 255, 255, .25); }
.a11y-foot a { color: #f5c451; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.a11y-panel :focus-visible { outline: 3px solid #f5c451; outline-offset: 2px; }
@media (max-width: 520px) {
  .a11y-panel { margin: auto 0 0; width: 100vw; max-width: 100vw; max-height: 88dvh; border-radius: 20px 20px 0 0; }
  .a11y-grid { grid-template-columns: 1fr; }
}

/* Гласов помощник: какво се чете в момента */
.a11y-speaking { outline: 3px solid #ffd400 !important; outline-offset: 3px; border-radius: 6px; background-color: rgba(255, 212, 0, .13) !important; }
.a11y-float { position: fixed; left: 16px; bottom: 16px; z-index: 990; display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 999px; border: 2px solid #1a1405; background: #ffd400; color: #1a1405; font: 800 15px "Manrope", system-ui, sans-serif; box-shadow: 0 12px 30px rgba(0, 0, 0, .5); cursor: pointer; }
.a11y-tap { position: fixed; left: 50%; bottom: 16px; z-index: 990; transform: translateX(-50%); max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: 14px; background: #ffd400; color: #1a1405; font: 700 14px "Manrope", system-ui, sans-serif; text-align: center; }

/* Линия за четене */
.a11y-guide { display: none; position: fixed; left: 0; right: 0; top: -14px; z-index: 980; height: 28px; pointer-events: none; background: rgba(255, 212, 0, .14); border-top: 2px solid #ffd400; border-bottom: 2px solid #ffd400; }
html.a11y-guide .a11y-guide { display: block; }

/* Размер на текста: всички шрифтове в styles.css/listen.css са calc(N * var(--fs)), оформлението се пренарежда */
html.a11y-zoom { --fs: var(--a11y-zoom, 1); }
html.a11y-zoom body { font-size: calc(16px * var(--fs, 1)); }
/* Големите заглавия вече са едри: растат по-малко, за да не излизат от телефона */
html.a11y-zoom :is(.hero h1, .bp-info h1, .au-panel h1, .simple h1) { --fs: 1; }
/* Кориците са картини: текстът върху тях не расте */
html.a11y-zoom :is(.hero-art, .book3d, .cover, .card-cover, .marquee) { --fs: 1; }
html.a11y-zoom :is(h2, .section-head h2) { --fs: min(var(--a11y-zoom, 1), 1.15); }
html.a11y-zoom :is(.hero, .bp-hero, .detail, .steps, .news, .grid, .bp-related, .au-main) > * { min-width: 0; }
html.a11y-zoom :is(h1, h2, h3, h4, p, li, dd, dt, a, button, label, .btn) { overflow-wrap: anywhere; }
@media (max-width: 600px) { html.a11y-zoom :is(.grid, .bp-related) { grid-template-columns: 1fr; } }

/* Висок контраст */
html.a11y-contrast {
  --bg: #000; --bg-2: #000; --card: #000; --card-2: #222; --line: #fff; --text: #fff; --muted: #fff; --ink: #fff; --ink-2: #fff;
  --gold: #ffe14d; --gold-2: #ffe14d; --violet: #ffe14d; --pink: #ffe14d;
}
html.a11y-contrast body { background: #000 !important; color: #fff !important; }
html.a11y-contrast :is(#stars, .orb, .au-bg, .marquee) { display: none !important; }
html.a11y-contrast :is(.nav, .nav.scrolled, .au-bar, .rd-bar) { background: #000 !important; backdrop-filter: none !important; border-bottom: 2px solid #fff !important; }
html.a11y-contrast :is(.card, .modal, .drawer, .step, .news, .pill, .lang-menu summary, .lang-menu ul, .chips button, .tabs, .icon-btn, .cart-btn, .account-btn, .a11y-btn, .btn-ghost, .bp-audio, .au-btn, .au-tool, .au-panel, .search, select, input:not([type=checkbox]):not([type=range]), .lang-suggest, .toast, .simple, .bp-sec, .faq details) {
  background: #000 !important; border: 2px solid #fff !important; box-shadow: none !important; color: #fff !important;
}
html.a11y-contrast :is(.btn-primary, .au-play, .tabs-thumb, .lang-menu a[aria-current], .chips button[aria-selected="true"], .au-voice a[aria-current="true"]) { background: #ffe14d !important; color: #000 !important; border-color: #ffe14d !important; }
html.a11y-contrast .tabs button[aria-selected="true"] { color: #000 !important; }
html.a11y-contrast :is(a:not(.btn):not(.brand):not(.skip-link):not(.card a), .link-btn, .au-link) { color: #ffe14d !important; }
html.a11y-contrast .skip-link { background: #ffe14d !important; color: #000 !important; }
html.a11y-contrast .grad { background: none !important; -webkit-text-fill-color: #ffe14d !important; color: #ffe14d !important; }
html.a11y-contrast :is(.muted, .hint, .small, .card-author, small) { color: #fff !important; opacity: 1 !important; }
html.a11y-contrast :focus-visible { outline: 3px solid #ffe14d !important; outline-offset: 3px !important; }
html.a11y-contrast .a11y-panel, html.a11y-contrast .a11y-head { background: #000; border-color: #fff; }
html.a11y-contrast :is(.a11y-sec, .a11y-sw) { background: #000; border: 2px solid #fff; }
html.a11y-contrast :is(.a11y-intro, .a11y-sw-text small, .a11y-seg button) { color: #fff; }

/* Лесно четим шрифт: без декоративни шрифтове, главни букви и сгъстяване */
html.a11y-font { --head: "Atkinson Hyperlegible", Verdana, "Segoe UI", Tahoma, Arial, "Noto Sans", sans-serif; --body: var(--head); }
html.a11y-font body, html.a11y-font body :not(svg, svg *, .cover-mark) { font-family: "Atkinson Hyperlegible", Verdana, "Segoe UI", Tahoma, Arial, "Noto Sans", sans-serif !important; text-transform: none !important; }
html.a11y-font :is(h1, h2, h3, h4) { letter-spacing: 0 !important; }

/* По-широки редове и букви (WCAG 1.4.12) */
html.a11y-spacing :is(p, li, dd, dt, label, blockquote, td, th, .hint, .bp-desc, .card-author, small) { line-height: 1.8 !important; letter-spacing: .06em !important; word-spacing: .16em !important; }
html.a11y-spacing :is(h1, h2, h3, h4) { line-height: 1.35 !important; letter-spacing: .02em !important; }
html.a11y-spacing p { margin-bottom: 1.2em; }

/* Подчертани връзки */
html.a11y-links a:not(.brand):not(.skip-link) { text-decoration: underline !important; text-decoration-thickness: 2px !important; text-underline-offset: 4px !important; }

/* Без анимации */
html.a11y-motion *, html.a11y-motion *::before, html.a11y-motion *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
html.a11y-motion :is(#stars, .orb) { display: none !important; }
html.a11y-motion .reveal { opacity: 1 !important; transform: none !important; }

/* Голям курсор */
html.a11y-cursor, html.a11y-cursor * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44' viewBox='0 0 44 44'%3E%3Cpath d='M4 3l0 33 9-8 6 13 7-3-6-13 12 0z' fill='%23000' stroke='%23fff' stroke-width='2.5' stroke-linejoin='round'/%3E%3C/svg%3E") 4 3, auto !important;
}
html.a11y-cursor :is(a, button, summary, label, select, [role=button], [role=tab], [role=switch]), html.a11y-cursor :is(a, button, summary, label, select, [role=button], [role=tab], [role=switch]) * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44' viewBox='0 0 44 44'%3E%3Cpath d='M4 3l0 33 9-8 6 13 7-3-6-13 12 0z' fill='%23ffd400' stroke='%23000' stroke-width='2.5' stroke-linejoin='round'/%3E%3C/svg%3E") 4 3, pointer !important;
}
html.a11y-cursor :is(input:not([type=checkbox]):not([type=range]), textarea) { cursor: text !important; }

/* Изявление за достъпност */
.a11y-stmt { text-align: left; max-width: 760px; }
.a11y-stmt h2 { margin: 26px 0 10px; font-size: 20px; }
.a11y-stmt ul { margin: 0 0 18px; padding-left: 22px; line-height: 1.7; }

/* Флагчета в менюто за език */
.lang-menu .flag { flex: none; width: 21px; height: 14px; border-radius: 3px; object-fit: cover; box-shadow: 0 0 0 1px rgba(255, 255, 255, .28); }
.lang-menu ul a { display: flex !important; align-items: center; gap: 9px; }
