.skip-link {
    position: absolute;
    top: -100px;
    left: 1rem;
    z-index: 10000;
    padding: 0.75rem 1rem;
    background: #1e264c;
    color: #fff;
    border-radius: 0.5rem;
    text-decoration: none;
}

.skip-link:focus {
    top: 1rem;
}

.sr-only,
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.visually-hidden-focusable:not(:focus):not(:focus-within) {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.page-with-fixed-header {
    padding-top: 80px;
    min-height: 100vh;
}

/* Accessibility widget (floating menu) */
.a11y-widget {
    position: fixed;
    left: 1rem;
    bottom: 1.5rem;
    z-index: 9998;
    font-family: Inter, system-ui, sans-serif;
}

.a11y-widget__toggle {
    width: 3.25rem;
    height: 3.25rem;
    border: none;
    border-radius: 50%;
    background: #1e264c;
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.a11y-widget__toggle:hover,
.a11y-widget__toggle:focus-visible {
    background: #161d3a;
    transform: scale(1.05);
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.a11y-widget__panel {
    position: absolute;
    left: 0;
    bottom: calc(100% + 0.75rem);
    width: min(18rem, calc(100vw - 2rem));
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.a11y-widget__panel[hidden] {
    display: none;
}

.a11y-widget__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.875rem 1rem;
    background: #1e264c;
    color: #fff;
}

.a11y-widget__title {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #fff;
}

.a11y-widget__close {
    border: none;
    background: transparent;
    color: #fff;
    font-size: 1.125rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
}

.a11y-widget__close:hover,
.a11y-widget__close:focus-visible {
    background: rgba(255, 255, 255, 0.15);
    outline: none;
}

.a11y-widget__menu {
    list-style: none;
    margin: 0;
    padding: 0.5rem;
    max-height: 22rem;
    overflow-y: auto;
}

.a11y-widget__item {
    margin: 0;
}

.a11y-widget__action {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 0.75rem;
    border: none;
    background: transparent;
    color: #1e293b;
    font-size: 0.875rem;
    text-align: left;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.a11y-widget__action:hover,
.a11y-widget__action:focus-visible {
    background: #f1f5f9;
    outline: none;
}

.a11y-widget__action.is-active {
    background: #e0e7ff;
    color: #1e264c;
    font-weight: 600;
}

.a11y-widget__action i {
    font-size: 1.125rem;
    width: 1.25rem;
    text-align: center;
    flex-shrink: 0;
}

.a11y-widget__divider {
    height: 1px;
    background: #e2e8f0;
    margin: 0.375rem 0.5rem;
}

/* Applied accessibility modes */
html.a11y-font-scale-1 {
    font-size: 112.5%;
}

html.a11y-font-scale-2 {
    font-size: 125%;
}

html.a11y-font-scale-3 {
    font-size: 150%;
}

html.a11y-high-contrast body {
    background: #000 !important;
    color: #fff !important;
}

html.a11y-high-contrast #header {
    background: #000 !important;
    border-bottom-color: #fff !important;
}

html.a11y-high-contrast a,
html.a11y-high-contrast .navbar a {
    color: #ffff00 !important;
}

html.a11y-high-contrast .btn,
html.a11y-high-contrast button {
    border: 1px solid #fff !important;
}

html.a11y-grayscale #main-content {
    filter: grayscale(100%);
}

html.a11y-highlight-links a {
    text-decoration: underline !important;
    text-underline-offset: 2px;
}

html.a11y-highlight-links a:focus-visible {
    outline: 3px solid #f59e0b !important;
    outline-offset: 2px;
}

html.a11y-readable-font body {
    font-family: Arial, Helvetica, sans-serif !important;
}

html.a11y-readable-font body * {
    font-family: inherit !important;
}

/* Document list stats */
.doc-list-stats {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-left: 0.25rem;
    font-size: 0.8125rem;
    color: #64748b;
}

.doc-list-stats__item {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
}

.doc-list-stats__item i {
    font-size: 0.875rem;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
