/* ==========================================================================
   Anchor Accessibility Widget
   ========================================================================== */

.anchor-a11y-widget {
    --aa-color: #5d93c8;
    --aa-accent: #335f8a;
    --aa-size: 58px;
    --aa-radius: 22px;
    position: fixed;
    z-index: 999999;
    font-family: "Avenir Next", "Segoe UI", Arial, sans-serif;
    line-height: 1.35;
    color: #162331;
}

.anchor-a11y-bottom-right {
    right: var(--aa-offset-x, 20px);
    bottom: var(--aa-offset-y, 20px);
}

.anchor-a11y-bottom-left {
    left: var(--aa-offset-x, 20px);
    bottom: var(--aa-offset-y, 20px);
}

.anchor-a11y-widget.is-widget-hidden {
    width: auto;
}

.anchor-a11y-toggle,
.anchor-a11y-restore {
    border: none;
    cursor: pointer;
    box-shadow: 0 18px 40px rgba(19, 31, 47, 0.18);
}

.anchor-a11y-toggle[hidden],
.anchor-a11y-restore[hidden] {
    display: none !important;
}

.anchor-a11y-toggle {
    width: var(--aa-size);
    height: var(--aa-size);
    border-radius: 50%;
    background: #ffffff;
    color: var(--aa-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.anchor-a11y-toggle-icon {
    width: calc(var(--aa-size) * 0.74);
    height: calc(var(--aa-size) * 0.74);
    display: block;
}

.anchor-a11y-toggle:hover,
.anchor-a11y-toggle:focus-visible,
.anchor-a11y-restore:hover,
.anchor-a11y-restore:focus-visible {
    transform: translateY(-1px);
}

.anchor-a11y-toggle:focus-visible,
.anchor-a11y-restore:focus-visible,
.anchor-a11y-card:focus-visible,
.anchor-a11y-profile-card:focus-visible,
.anchor-a11y-section-toggle:focus-visible,
.anchor-a11y-choice-list button:focus-visible,
.anchor-a11y-linklike:focus-visible,
.anchor-a11y-reset:focus-visible,
.anchor-a11y-modal-close:focus-visible,
.anchor-a11y-structure-item:focus-visible {
    outline: 3px solid var(--aa-accent);
    outline-offset: 3px;
}

.anchor-a11y-restore {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--aa-size);
    height: var(--aa-size);
    padding: 0;
    border-radius: 50%;
    background: #ffffff;
    color: var(--aa-color);
}

.anchor-a11y-panel {
    position: absolute;
    bottom: calc(var(--aa-size) + 18px);
    width: min(440px, calc(100vw - 28px));
    max-height: 82vh;
    background: #f5f6f8;
    border-radius: 26px;
    box-shadow: 0 24px 60px rgba(15, 23, 36, 0.22);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.anchor-a11y-bottom-right .anchor-a11y-panel {
    right: 0;
}

.anchor-a11y-bottom-left .anchor-a11y-panel {
    left: 0;
}

.anchor-a11y-panel[hidden],
.anchor-a11y-popover[hidden],
.anchor-a11y-modal[hidden],
.anchor-a11y-modal-backdrop[hidden],
.anchor-a11y-reading-guide[hidden],
.anchor-a11y-reading-mask[hidden],
.anchor-a11y-tooltip[hidden] {
    display: none;
}

.anchor-a11y-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    background: #ffffff;
    border-bottom: 1px solid #e4e8ee;
}

.anchor-a11y-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.anchor-a11y-title-wrap strong {
    font-size: 20px;
    font-weight: 700;
}

.anchor-a11y-title-wrap small {
    font-size: 12px;
    color: #68768a;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.anchor-a11y-close,
.anchor-a11y-modal-close {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: rgba(93, 147, 200, 0.12);
    color: var(--aa-accent);
    font-size: 28px;
    cursor: pointer;
}

.anchor-a11y-body {
    flex: 1;
    overflow-y: auto;
    padding: 18px 16px 16px;
}

.anchor-a11y-section + .anchor-a11y-section {
    margin-top: 16px;
}

.anchor-a11y-section-heading {
    padding: 0 6px 12px;
    margin-bottom: 4px;
    border-bottom: 1px solid #d9e0e8;
    font-size: 15px;
    font-weight: 700;
    color: #516171;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.anchor-a11y-section-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
    border: none;
    padding: 0 6px 10px;
    font-size: 17px;
    font-weight: 700;
    color: #202c3c;
    cursor: pointer;
}

.anchor-a11y-profiles-grid,
.anchor-a11y-card-grid {
    display: grid;
    gap: 12px;
}

.anchor-a11y-profiles-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.anchor-a11y-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.anchor-a11y-profile-card,
.anchor-a11y-card {
    position: relative;
    border: 1px solid #e3e7ed;
    border-radius: 24px;
    background: #ffffff;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.anchor-a11y-profile-card:hover,
.anchor-a11y-card:hover {
    border-color: rgba(93, 147, 200, 0.45);
    box-shadow: 0 10px 22px rgba(33, 62, 92, 0.1);
}

.anchor-a11y-profile-card {
    min-height: 108px;
    padding: 18px 18px 20px;
}

.anchor-a11y-card {
    min-height: 124px;
    padding: 16px 16px 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.anchor-a11y-profile-card.is-active,
.anchor-a11y-card.is-active {
    border-color: #70a3d3;
    box-shadow: 0 0 0 3px rgba(93, 147, 200, 0.18);
}

.anchor-a11y-profile-name,
.anchor-a11y-card-title {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: #182432;
}

.anchor-a11y-card-meta {
    display: block;
    margin-top: 8px;
    font-size: 13px;
    color: #6e7a89;
}

.anchor-a11y-check {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #6ea3d3;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.anchor-a11y-profile-card.is-active .anchor-a11y-check,
.anchor-a11y-card.is-active .anchor-a11y-check {
    opacity: 1;
    transform: scale(1);
}

.anchor-a11y-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px 18px;
    border-top: 1px solid #e4e8ee;
    background: #ffffff;
}

.anchor-a11y-reset,
.anchor-a11y-linklike {
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--aa-color);
    font-size: 14px;
    font-weight: 700;
    padding: 0;
}

.anchor-a11y-statement {
    font-size: 13px;
    color: var(--aa-accent);
    font-weight: 700;
    text-decoration: none;
}

.anchor-a11y-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(17, 26, 38, 0.45);
    z-index: 999996;
}

.anchor-a11y-popover,
.anchor-a11y-modal {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 999997;
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 22px 60px rgba(9, 16, 28, 0.28);
}

.anchor-a11y-popover {
    width: min(360px, calc(100vw - 24px));
    padding: 18px;
}

.anchor-a11y-modal {
    width: min(760px, calc(100vw - 24px));
    max-height: 82vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.anchor-a11y-popover-title,
.anchor-a11y-modal-header strong {
    font-size: 20px;
    font-weight: 700;
    color: #182432;
}

.anchor-a11y-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    background: #6ea3d3;
    color: #ffffff;
}

.anchor-a11y-modal-header strong {
    color: #ffffff;
}

.anchor-a11y-choice-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.anchor-a11y-choice-list button {
    width: 100%;
    border: 1px solid #dbe2ea;
    border-radius: 16px;
    background: #f7f8fb;
    color: #1c2937;
    font-size: 15px;
    font-weight: 600;
    padding: 14px 16px;
    text-align: left;
    cursor: pointer;
}

.anchor-a11y-choice-list button:hover {
    border-color: rgba(93, 147, 200, 0.55);
    background: #eef5fb;
}

.anchor-a11y-modal-body {
    overflow-y: auto;
    padding: 16px 18px 18px;
    background: #ffffff;
}

.anchor-a11y-modal-tabs {
    display: flex;
    border-bottom: 1px solid #e4e8ee;
    background: #f7f8fb;
}

.anchor-a11y-modal-tabs button {
    flex: 1;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 14px 10px;
    color: #5f84ad;
    font-size: 16px;
    font-weight: 700;
}

.anchor-a11y-modal-tabs button.is-active {
    background: #ffffff;
    color: #182432;
}

.anchor-a11y-structure-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.anchor-a11y-structure-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    border: none;
    border-radius: 14px;
    background: #f7f9fc;
    cursor: pointer;
    padding: 12px 14px;
    text-align: left;
    color: #18314e;
    font-size: 15px;
}

.anchor-a11y-structure-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    min-height: 36px;
    padding: 0 10px;
    border-radius: 12px;
    background: #6f96c3;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
}

.anchor-a11y-dictionary-form {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.anchor-a11y-dictionary-input {
    flex: 1;
    min-width: 0;
    border: 1px solid #cfd8e3;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 15px;
}

.anchor-a11y-dictionary-submit {
    border: none;
    border-radius: 12px;
    background: var(--aa-color);
    color: #ffffff;
    cursor: pointer;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 700;
}

.anchor-a11y-dictionary-result p,
.anchor-a11y-definition-group {
    margin: 0 0 14px;
}

.anchor-a11y-definition-group h4 {
    margin: 0 0 8px;
    font-size: 15px;
}

.anchor-a11y-definition-group ol {
    margin: 0;
    padding-left: 20px;
}

.anchor-a11y-tooltip {
    position: fixed;
    z-index: 999998;
    max-width: 260px;
    border-radius: 14px;
    background: rgba(13, 20, 31, 0.92);
    color: #ffffff;
    padding: 10px 12px;
    font-size: 13px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
    pointer-events: none;
}

.anchor-a11y-reading-guide {
    position: fixed;
    left: 0;
    right: 0;
    height: 24px;
    pointer-events: none;
    z-index: 999995;
}

.anchor-a11y-reading-guide::before {
    content: "";
    position: absolute;
    inset: 8px 0 8px 0;
    background: #f5dc64;
    box-shadow: inset 0 0 0 3px rgba(255, 232, 120, 0.7);
}

.anchor-a11y-reading-guide::after {
    content: "";
    position: absolute;
    left: 8%;
    right: 8%;
    top: 11px;
    height: 8px;
    background: #111111;
    border-radius: 999px;
}

.anchor-a11y-reading-mask {
    position: fixed;
    left: 0;
    width: 100vw;
    background: rgba(11, 18, 28, 0.46);
    pointer-events: none;
    z-index: 999994;
}

.anchor-a11y-reading-mask-top {
    top: 0;
    border-bottom: 4px solid rgba(78, 126, 196, 0.88);
}

.anchor-a11y-reading-mask-bottom {
    bottom: 0;
    top: auto;
    height: 0;
    border-top: 4px solid rgba(104, 191, 137, 0.88);
}

.anchor-a11y-live {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ==========================================================================
   Page-level accessibility states
   ========================================================================== */

body.aa-highlight-links a {
    text-decoration: underline !important;
    text-decoration-thickness: 2px !important;
    text-underline-offset: 0.16em !important;
}

body.aa-readable,
body.aa-readable * {
    font-family: "OpenDyslexic", "Comic Sans MS", "Arial", sans-serif !important;
    letter-spacing: 0.05em;
}

body.aa-spacing-1,
body.aa-spacing-1 * {
    letter-spacing: 0.04em !important;
    word-spacing: 0.08em !important;
    line-height: 1.55 !important;
}

body.aa-spacing-2,
body.aa-spacing-2 * {
    letter-spacing: 0.08em !important;
    word-spacing: 0.14em !important;
    line-height: 1.72 !important;
}

body.aa-spacing-3,
body.aa-spacing-3 * {
    letter-spacing: 0.12em !important;
    word-spacing: 0.18em !important;
    line-height: 1.9 !important;
}

body.aa-hide-images img,
body.aa-hide-images svg,
body.aa-hide-images picture,
body.aa-hide-images video,
body.aa-hide-images canvas,
body.aa-hide-images [role="img"] {
    visibility: hidden !important;
}

body.aa-big-cursor,
body.aa-big-cursor * {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48'%3E%3Cpath d='M4 4l15 34 6-14 14-6z' fill='%230b0b0b' stroke='%23ffffff' stroke-width='2'/%3E%3C/svg%3E") 4 4, auto !important;
}

body.aa-pause-anim *,
body.aa-pause-anim *::before,
body.aa-pause-anim *::after {
    animation-play-state: paused !important;
    animation-duration: 0s !important;
    transition-duration: 0s !important;
    scroll-behavior: auto !important;
}

body.aa-highlight *:focus-visible {
    outline: 3px solid #0e67c7 !important;
    outline-offset: 3px !important;
}

body.aa-lineheight-1 :is(p, li, blockquote, dd, dt, td, th, label, legend, figcaption) {
    line-height: 1.55 !important;
}

body.aa-lineheight-2 :is(p, li, blockquote, dd, dt, td, th, label, legend, figcaption) {
    line-height: 1.75 !important;
}

body.aa-lineheight-3 :is(p, li, blockquote, dd, dt, td, th, label, legend, figcaption) {
    line-height: 2 !important;
}

body.aa-align-left :is(p, li, blockquote, dd, dt, td, th, label, legend, figcaption, h1, h2, h3, h4, h5, h6) {
    text-align: left !important;
}

body.aa-align-center :is(p, li, blockquote, dd, dt, td, th, label, legend, figcaption, h1, h2, h3, h4, h5, h6) {
    text-align: center !important;
}

body.aa-align-right :is(p, li, blockquote, dd, dt, td, th, label, legend, figcaption, h1, h2, h3, h4, h5, h6) {
    text-align: right !important;
}

body.aa-align-justify :is(p, li, blockquote, dd, dt, td, th, label, legend, figcaption) {
    text-align: justify !important;
}

body.aa-contrast-dark,
body.aa-contrast-dark :is(main, section, article, aside, nav, header, footer, div, p, li, span, label, td, th, strong, em, small, blockquote, h1, h2, h3, h4, h5, h6) {
    background-color: #11151a !important;
    color: #f7f9fb !important;
    border-color: rgba(255, 255, 255, 0.18) !important;
}

body.aa-contrast-dark a,
body.aa-contrast-dark button {
    color: #ffd86a !important;
}

body.aa-contrast-light,
body.aa-contrast-light :is(main, section, article, aside, nav, header, footer, div, p, li, span, label, td, th, strong, em, small, blockquote, h1, h2, h3, h4, h5, h6) {
    background-color: #ffffff !important;
    color: #0c0f14 !important;
    border-color: rgba(0, 0, 0, 0.18) !important;
}

body.aa-contrast-light a,
body.aa-contrast-light button {
    color: #0039a6 !important;
}

@media (max-width: 720px) {
    .anchor-a11y-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .anchor-a11y-profiles-grid {
        grid-template-columns: 1fr;
    }

    .anchor-a11y-dictionary-form {
        flex-direction: column;
    }
}
