:root {
    --a11y-font-scale: 1;
}

html {
    scroll-behavior: smooth;
}

body {
    font-size: calc(1rem * var(--a11y-font-scale));
}

.skip-link {
    position: fixed;
    z-index: 10000;
    top: 12px;
    left: 12px;
    padding: 12px 16px;
    border: 3px solid #111;
    border-radius: 6px;
    background: #fff;
    color: #111;
    font-weight: 800;
    text-decoration: none;
    transform: translateY(-180%);
    transition: transform .15s ease;
}

.skip-link:focus {
    transform: translateY(0);
}

:focus-visible {
    outline: 3px solid #005fcc;
    outline-offset: 3px;
}

button,
input,
select,
textarea,
a {
    -webkit-tap-highlight-color: rgba(238, 121, 0, .2);
}

button,
input,
select,
textarea {
    font: inherit;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    border-color: #005fcc !important;
}

img,
svg {
    max-width: 100%;
}

.a11y-launcher {
    position: fixed;
    z-index: 850;
    right: 20px;
    bottom: 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 46px;
    padding: 10px 15px;
    border: 2px solid #fff;
    border-radius: 999px;
    background: #202020;
    color: #fff;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .25);
    font-weight: 800;
    cursor: pointer;
}

.a11y-launcher:hover,
.a11y-launcher:focus-visible {
    background: #000;
}

.a11y-launcher-icon {
    color: #ee7900;
    font-size: 18px;
}

.a11y-backdrop {
    position: fixed;
    z-index: 890;
    inset: 0;
    background: rgba(0, 0, 0, .46);
}

.a11y-panel {
    position: fixed;
    z-index: 900;
    top: 0;
    right: 0;
    width: min(430px, calc(100vw - 20px));
    height: 100dvh;
    overflow-y: auto;
    padding: 24px;
    border-left: 1px solid #d8d8d8;
    background: #fff;
    color: #202020;
    box-shadow: -16px 0 44px rgba(0, 0, 0, .22);
}

.a11y-panel[hidden],
.a11y-backdrop[hidden] {
    display: none !important;
}

.a11y-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid #e3e3e3;
}

.a11y-kicker {
    display: block;
    margin-bottom: 4px;
    color: #c85500;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.a11y-panel h2 {
    margin: 0;
    font-size: 30px;
}

.a11y-panel h3 {
    margin: 0 0 12px;
    font-size: 18px;
}

.a11y-close {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border: 1px solid #bbb;
    border-radius: 50%;
    background: #fff;
    color: #111;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
}

.a11y-section {
    padding: 20px 0;
    border-bottom: 1px solid #e3e3e3;
}

.a11y-control-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.a11y-control-row button,
.a11y-options button,
.a11y-reset {
    min-height: 48px;
    border: 2px solid #242424;
    border-radius: 8px;
    background: #fff;
    color: #202020;
    font-weight: 800;
    cursor: pointer;
}

.a11y-control-row button:hover,
.a11y-options button:hover,
.a11y-reset:hover,
.a11y-options button[aria-pressed="true"] {
    border-color: #c85500;
    background: #fff4e9;
    color: #7f3500;
}

.a11y-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.a11y-options button {
    padding: 10px 12px;
    text-align: left;
}

.a11y-panel-footer {
    padding-top: 20px;
}

.a11y-panel-footer > a {
    display: inline-block;
    margin: 16px 0 8px;
    color: #9b4100;
    font-weight: 800;
}

.a11y-panel-footer p {
    margin: 8px 0 0;
    color: #666;
    font-size: 13px;
    line-height: 1.55;
}

.a11y-live {
    position: fixed;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.accessibility-declaration kbd {
    display: inline-block;
    min-width: 28px;
    padding: 2px 6px;
    border: 1px solid #bbb;
    border-bottom-width: 2px;
    border-radius: 4px;
    background: #f4f4f4;
    color: #222;
    font-family: inherit;
    font-size: .9em;
    text-align: center;
}

.a11y-declaration-meta {
    padding-left: 22px;
}

/* Tryby panelu */
html.a11y-readable-font body,
html.a11y-readable-font button,
html.a11y-readable-font input,
html.a11y-readable-font select,
html.a11y-readable-font textarea {
    font-family: Arial, Helvetica, sans-serif !important;
}

html.a11y-underline-links a:not(.button) {
    text-decoration: underline !important;
    text-decoration-thickness: 2px !important;
    text-underline-offset: 3px !important;
}

html.a11y-highlight-headings h1,
html.a11y-highlight-headings h2,
html.a11y-highlight-headings h3,
html.a11y-highlight-headings h4,
html.a11y-highlight-headings h5,
html.a11y-highlight-headings h6 {
    padding-left: .45em !important;
    border-left: 6px solid #ee7900 !important;
    background-image: linear-gradient(90deg, rgba(238, 121, 0, .13), transparent) !important;
}

html.a11y-strong-focus :focus-visible {
    outline: 5px solid #005fcc !important;
    outline-offset: 4px !important;
    box-shadow: 0 0 0 2px #fff !important;
}

html.a11y-line-spacing body,
html.a11y-line-spacing p,
html.a11y-line-spacing li,
html.a11y-line-spacing label,
html.a11y-line-spacing td,
html.a11y-line-spacing th {
    line-height: 1.9 !important;
}

html.a11y-letter-spacing body,
html.a11y-letter-spacing p,
html.a11y-letter-spacing li,
html.a11y-letter-spacing label,
html.a11y-letter-spacing a,
html.a11y-letter-spacing button {
    letter-spacing: .08em !important;
    word-spacing: .12em !important;
}

html.a11y-large-cursor,
html.a11y-large-cursor * {
    cursor: url('/images/a11y-cursor.svg') 3 3, auto !important;
}

html.a11y-grayscale body {
    filter: grayscale(1);
}

html.a11y-high-contrast body,
html.a11y-high-contrast main,
html.a11y-high-contrast header,
html.a11y-high-contrast footer,
html.a11y-high-contrast section,
html.a11y-high-contrast article,
html.a11y-high-contrast nav,
html.a11y-high-contrast div:not(.a11y-backdrop),
html.a11y-high-contrast form {
    background-color: #000 !important;
    background-image: none !important;
    color: #fff !important;
    border-color: #fff !important;
    box-shadow: none !important;
}

html.a11y-high-contrast p,
html.a11y-high-contrast span,
html.a11y-high-contrast small,
html.a11y-high-contrast strong,
html.a11y-high-contrast h1,
html.a11y-high-contrast h2,
html.a11y-high-contrast h3,
html.a11y-high-contrast h4,
html.a11y-high-contrast h5,
html.a11y-high-contrast h6,
html.a11y-high-contrast li,
html.a11y-high-contrast label,
html.a11y-high-contrast td,
html.a11y-high-contrast th {
    color: #fff !important;
}

html.a11y-high-contrast a,
html.a11y-high-contrast .text-link {
    color: #ffeb3b !important;
}

html.a11y-high-contrast button,
html.a11y-high-contrast .button {
    border-color: #fff !important;
    background: #000 !important;
    color: #ffeb3b !important;
}

html.a11y-high-contrast input,
html.a11y-high-contrast select,
html.a11y-high-contrast textarea {
    border: 2px solid #fff !important;
    background: #000 !important;
    color: #fff !important;
}

html.a11y-high-contrast .a11y-panel {
    border-left-color: #fff !important;
}

html.a11y-high-contrast img {
    outline: 2px solid #fff;
}

html.a11y-reduce-motion *,
html.a11y-reduce-motion *::before,
html.a11y-reduce-motion *::after {
    scroll-behavior: auto !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
}

@media (max-width: 700px) {
    .a11y-launcher {
        right: 12px;
        bottom: 12px;
    }

    .a11y-panel {
        width: 100%;
        padding: 20px 16px;
    }

    .a11y-options {
        grid-template-columns: 1fr;
    }
}
/* ================================================================
   2026-08-19 — pełna responsywność panelu dostępności
   ================================================================ */

body.a11y-panel-open {
    overflow: hidden;
    overscroll-behavior: none;
}

.a11y-panel,
.a11y-panel *,
.a11y-launcher,
.a11y-launcher * {
    box-sizing: border-box;
}

.a11y-panel {
    overscroll-behavior: contain;
}

@media (max-width: 700px) {
    .a11y-launcher {
        right: max(10px, env(safe-area-inset-right));
        bottom: max(10px, env(safe-area-inset-bottom));
        min-height: 44px;
        max-width: calc(100vw - 20px);
        padding: 8px 13px;
        gap: 7px;
        border-width: 2px;
        font-size: 15px;
        line-height: 1.2;
        white-space: nowrap;
    }

    .a11y-launcher-icon {
        flex: 0 0 auto;
        font-size: 16px;
    }

    .a11y-backdrop {
        width: 100vw;
        height: 100dvh;
    }

    .a11y-panel {
        inset: 0;
        left: 0;
        right: 0;
        width: 100vw !important;
        max-width: 100vw;
        height: 100dvh;
        max-height: 100dvh;
        padding:
            max(14px, env(safe-area-inset-top))
            14px
            calc(22px + env(safe-area-inset-bottom));
        border-left: 0;
        border-radius: 0;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .a11y-panel-header {
        position: sticky;
        z-index: 3;
        top: calc(-1 * max(14px, env(safe-area-inset-top)));
        align-items: center;
        margin:
            calc(-1 * max(14px, env(safe-area-inset-top)))
            -14px
            0;
        padding:
            max(14px, env(safe-area-inset-top))
            14px
            14px;
        background: #fff;
        border-bottom: 1px solid #dedede;
    }

    html.a11y-high-contrast .a11y-panel-header {
        background: #000 !important;
        border-color: #fff !important;
    }

    .a11y-panel h2 {
        font-size: 25px;
        line-height: 1.15;
    }

    .a11y-kicker {
        font-size: 10px;
    }

    .a11y-close {
        width: 44px;
        height: 44px;
        flex: 0 0 44px;
        font-size: 28px;
    }

    .a11y-section {
        padding: 16px 0;
    }

    .a11y-panel h3 {
        margin-bottom: 10px;
        font-size: 17px;
    }

    .a11y-control-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 7px;
    }

    .a11y-control-row button {
        min-width: 0;
        min-height: 48px;
        padding: 8px 5px;
        font-size: 15px;
    }

    .a11y-options {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .a11y-options button,
    .a11y-reset {
        width: 100%;
        min-height: 48px;
        padding: 11px 12px;
        text-align: left;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .a11y-panel-footer {
        padding-top: 17px;
    }

    .a11y-panel-footer > a {
        display: inline-block;
        max-width: 100%;
        margin: 14px 0 7px;
        overflow-wrap: anywhere;
    }

    .a11y-panel-footer p {
        font-size: 12.5px;
        line-height: 1.5;
    }
}

@media (max-width: 390px) {
    .a11y-launcher {
        padding: 8px 11px;
        font-size: 14px;
    }

    .a11y-panel {
        padding-inline: 12px;
    }

    .a11y-panel-header {
        margin-inline: -12px;
        padding-inline: 12px;
    }

    .a11y-control-row {
        gap: 6px;
    }

    .a11y-control-row button {
        min-height: 46px;
        font-size: 14px;
    }
}
