/**
 * PK Accessibility - Frontend Stylesheet
 * Customizable assistive toolbar with harmonious color management and responsive layouts.
 */

:root {
    --pk-acc-bg: #ffffff;
    --pk-acc-header-bg: #f8fafc;
    --pk-acc-border: #e2e8f0;
    --pk-acc-text: #1e293b;
    --pk-acc-text-muted: #64748b;
    --pk-acc-card-bg: #f8fafc;
    --pk-acc-card-border: #e2e8f0;
    --pk-acc-accent: #0f172a;
    --pk-acc-accent-text: #ffffff;
    --pk-acc-sec-bg: #f1f5f9;
    --pk-acc-sec-text: #334155;
    --pk-acc-btn-bg: #0f172a;
    --pk-acc-btn-text: #ffffff;
    --pk-acc-btn-radius: 50px;
    --pk-acc-panel-radius: 16px;
    --pk-acc-panel-max-width: 420px;
}

/* Skip to content link */
.pk-acc-skip-link {
    position: absolute;
    top: -999px;
    left: 20px;
    background: var(--pk-acc-accent, #0f172a);
    color: #ffffff !important;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    border-radius: 0 0 6px 6px;
    z-index: 100000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    transition: top 0.2s ease-in-out;
}
.pk-acc-skip-link:focus {
    top: 0;
    outline: 3px solid #ffffff;
    outline-offset: 2px;
}

/* Screen reader only utility */
.pk-acc-sr-only {
    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;
}

/* Floating Trigger Button */
.pk-acc-trigger-btn {
    position: fixed;
    z-index: 999990;
    pointer-events: auto !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, opacity 0.2s ease, bottom 0.25s ease;
    background-color: var(--pk-acc-btn-bg, #0f172a);
    color: var(--pk-acc-btn-text, #ffffff);
    border-radius: var(--pk-acc-btn-radius, 0px);
    padding: 0;
    margin: 0;
    user-select: none;
    font-size: 13px;
    font-weight: 600;
}
.pk-acc-trigger-btn:hover {
    transform: scale(1.06);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}
.pk-acc-trigger-btn:focus-visible {
    outline: 3px solid var(--pk-acc-accent, #0f172a);
    outline-offset: 3px;
}

/* Trigger Button Positions */
.pk-acc-pos-bottom-right { bottom: 20px; right: 20px; }
.pk-acc-pos-bottom-left  { bottom: 20px; left: 20px; }
.pk-acc-pos-top-right     { top: 20px; right: 20px; }
.pk-acc-pos-top-left      { top: 20px; left: 20px; }
.pk-acc-pos-middle-right  { top: 50%; right: 20px; transform: translateY(-50%); }
.pk-acc-pos-middle-right:hover { transform: translateY(-50%) scale(1.06); }
.pk-acc-pos-middle-left   { top: 50%; left: 20px; transform: translateY(-50%); }
.pk-acc-pos-middle-left:hover { transform: translateY(-50%) scale(1.06); }

/* Prevent overlap with PK Privacy & Cookie Consent badge */
body:has(#pk-pcc-badge.pk-pcc-visible) #pk-acc-trigger.pk-acc-pos-bottom-left,
body.has-pk-pcc-badge #pk-acc-trigger.pk-acc-pos-bottom-left,
#pk-acc-trigger.pk-acc-stacked-above-pcc {
    bottom: 74px !important;
}

/* Trigger Button Shapes & Sizes */
.pk-acc-trigger-btn {
    border-radius: var(--pk-acc-btn-radius, 0px) !important;
}
.pk-acc-shape-circle   { border-radius: var(--pk-acc-btn-radius, 50%) !important; }
.pk-acc-shape-squircle { border-radius: var(--pk-acc-btn-radius, 14px) !important; }
.pk-acc-shape-rounded  { border-radius: var(--pk-acc-btn-radius, 20px) !important; }
.pk-acc-shape-square   { border-radius: var(--pk-acc-btn-radius, 0px) !important; }

.pk-acc-size-small  { height: 50px; min-width: 50px; width: 50px; }
.pk-acc-size-small.pk-acc-trigger-btn svg { width: 18px; height: 18px; }
.pk-acc-size-medium { height: 50px; min-width: 50px; }
.pk-acc-size-large  { height: 58px; min-width: 58px; }

.pk-acc-trigger-btn svg {
    color: inherit;
    fill: currentColor;
    display: block;
}

.pk-acc-trigger-text {
    font-size: 13px;
    font-weight: 600;
    color: inherit;
    white-space: nowrap;
}

/* Pulse animation */
.pk-acc-pulse::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: inherit;
    border: 2px solid var(--pk-acc-accent, #0f172a);
    animation: pkAccPulse 2.2s infinite cubic-bezier(0.24, 0, 0.38, 1);
    pointer-events: none;
}
@keyframes pkAccPulse {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.2); opacity: 0; }
    100% { transform: scale(0.95); opacity: 0; }
}

/* Backdrop Overlay */
.pk-acc-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999995;
    display: none;
    opacity: 0;
    pointer-events: none !important;
    transition: opacity 0.25s ease;
}
.pk-acc-overlay.pk-acc-open {
    display: flex !important;
    opacity: 1;
    pointer-events: auto !important;
}

/* Layout 1: popup_left (Default) */
.pk-acc-overlay.pk-acc-layout-popup_left {
    justify-content: flex-start;
    align-items: flex-end;
    padding: 24px;
}
.pk-acc-layout-popup_left .pk-acc-drawer {
    width: var(--pk-acc-panel-max-width, 420px);
    max-width: calc(100vw - 48px);
    max-height: calc(100vh - 100px);
    max-height: calc(100dvh - 100px);
    height: auto;
    border-radius: var(--pk-acc-panel-radius, 16px);
    transform: translateY(20px) scale(0.96);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
}
.pk-acc-overlay.pk-acc-open.pk-acc-layout-popup_left .pk-acc-drawer {
    transform: translateY(0) scale(1);
}

/* Layout 2: popup_right */
.pk-acc-overlay.pk-acc-layout-popup_right {
    justify-content: flex-end;
    align-items: flex-end;
    padding: 24px;
}
.pk-acc-layout-popup_right .pk-acc-drawer {
    width: var(--pk-acc-panel-max-width, 420px);
    max-width: calc(100vw - 48px);
    max-height: calc(100vh - 100px);
    max-height: calc(100dvh - 100px);
    height: auto;
    border-radius: var(--pk-acc-panel-radius, 16px);
    transform: translateY(20px) scale(0.96);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
}
.pk-acc-overlay.pk-acc-open.pk-acc-layout-popup_right .pk-acc-drawer {
    transform: translateY(0) scale(1);
}

/* Layout 3: modal */
.pk-acc-overlay.pk-acc-layout-modal {
    justify-content: center;
    align-items: center;
    padding: 20px;
}
.pk-acc-layout-modal .pk-acc-drawer {
    width: var(--pk-acc-panel-max-width, 480px);
    max-width: 92vw;
    max-height: 85vh;
    max-height: 85dvh;
    height: auto;
    border-radius: var(--pk-acc-panel-radius, 16px);
    transform: scale(0.94);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.22);
}
.pk-acc-overlay.pk-acc-open.pk-acc-layout-modal .pk-acc-drawer {
    transform: scale(1);
}

/* Layout 4: drawer_left */
.pk-acc-overlay.pk-acc-layout-drawer_left {
    justify-content: flex-start;
    align-items: stretch;
}
.pk-acc-layout-drawer_left .pk-acc-drawer {
    width: var(--pk-acc-panel-max-width, 410px);
    max-width: 94vw;
    height: 100vh;
    height: 100dvh;
    transform: translateX(-100%);
    box-shadow: 10px 0 35px rgba(0, 0, 0, 0.18);
    border-radius: 0;
}
.pk-acc-overlay.pk-acc-open.pk-acc-layout-drawer_left .pk-acc-drawer {
    transform: translateX(0);
}

/* Layout 5: drawer_right */
.pk-acc-overlay.pk-acc-layout-drawer_right {
    justify-content: flex-end;
    align-items: stretch;
}
.pk-acc-layout-drawer_right .pk-acc-drawer {
    width: var(--pk-acc-panel-max-width, 410px);
    max-width: 94vw;
    height: 100vh;
    height: 100dvh;
    transform: translateX(100%);
    box-shadow: -10px 0 35px rgba(0, 0, 0, 0.18);
    border-radius: 0;
}
.pk-acc-overlay.pk-acc-open.pk-acc-layout-drawer_right .pk-acc-drawer {
    transform: translateX(0);
}

/* Drawer / Sidebar Panel Base */
.pk-acc-drawer {
    background: var(--pk-acc-bg, #ffffff);
    color: var(--pk-acc-text, #1e293b);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--pk-acc-border, #e2e8f0);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    overflow: hidden;
}

/* Header */
.pk-acc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--pk-acc-border, #e2e8f0);
    background: var(--pk-acc-header-bg, #f8fafc);
    flex-shrink: 0;
}
.pk-acc-header-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--pk-acc-text, #0f172a);
    letter-spacing: -0.3px;
}
.pk-acc-close {
    background: transparent;
    border: 1px solid var(--pk-acc-border, #cbd5e1);
    border-radius: 6px;
    color: var(--pk-acc-text-muted, #64748b);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
}
.pk-acc-close:hover {
    color: var(--pk-acc-accent, #0f172a);
    border-color: var(--pk-acc-accent, #0f172a);
    background: rgba(0, 0, 0, 0.05);
}

/* Scrollable Body */
.pk-acc-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.pk-acc-body::-webkit-scrollbar {
    width: 6px;
}
.pk-acc-body::-webkit-scrollbar-track {
    background: var(--pk-acc-bg, #ffffff);
}
.pk-acc-body::-webkit-scrollbar-thumb {
    background: var(--pk-acc-border, #cbd5e1);
    border-radius: 3px;
}
.pk-acc-body::-webkit-scrollbar-thumb:hover {
    background: var(--pk-acc-accent, #0f172a);
}

/* Sections */
.pk-acc-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.pk-acc-section-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--pk-acc-text, #0f172a);
    border-bottom: 1px solid var(--pk-acc-border, #e2e8f0);
    padding-bottom: 6px;
    letter-spacing: -0.2px;
}

/* Profiles Switch List */
.pk-acc-profiles-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.pk-acc-toggle-row {
    background: var(--pk-acc-card-bg, #f8fafc);
    border: 1px solid var(--pk-acc-card-border, #e2e8f0);
    border-radius: 8px;
    padding: 11px 14px;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.pk-acc-toggle-row:hover {
    border-color: var(--pk-acc-accent, #0f172a);
}
.pk-acc-toggle-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    gap: 12px;
}
.pk-acc-toggle-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.pk-acc-toggle-title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--pk-acc-text, #1e293b);
}
.pk-acc-toggle-desc {
    font-size: 11.5px;
    color: var(--pk-acc-text-muted, #64748b);
    line-height: 1.35;
}

/* iOS-style Switch Slider */
.pk-acc-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}
.pk-acc-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.pk-acc-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #cbd5e1;
    border-radius: 24px;
    transition: background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.pk-acc-slider::before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: #ffffff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.pk-acc-switch input:checked + .pk-acc-slider {
    background-color: var(--pk-acc-accent, #0f172a);
}
.pk-acc-switch input:checked + .pk-acc-slider::before {
    transform: translateX(20px);
}

/* Dictionary Search */
.pk-acc-dict-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.pk-acc-dict-input-wrap {
    display: flex;
    align-items: center;
    background: var(--pk-acc-card-bg, #f8fafc);
    border: 1px solid var(--pk-acc-card-border, #cbd5e1);
    border-radius: 8px;
    padding: 2px 8px 2px 12px;
    transition: border-color 0.15s ease;
}
.pk-acc-dict-input-wrap:focus-within {
    border-color: var(--pk-acc-accent, #0f172a);
    box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.12);
}
.pk-acc-dict-logo {
    font-family: Georgia, serif;
    font-weight: 700;
    font-size: 17px;
    color: var(--pk-acc-text-muted, #64748b);
    margin-right: 8px;
}
.pk-acc-dict-input {
    flex: 1;
    background: transparent;
    border: none !important;
    outline: none !important;
    color: var(--pk-acc-text, #1e293b);
    font-size: 13px;
    padding: 9px 4px;
}
.pk-acc-dict-btn {
    background: transparent;
    border: none;
    color: var(--pk-acc-text-muted, #64748b);
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pk-acc-dict-btn:hover {
    color: var(--pk-acc-accent, #0f172a);
}
.pk-acc-dict-hint {
    font-size: 11px;
    color: var(--pk-acc-text-muted, #64748b);
    display: flex;
    align-items: center;
    gap: 4px;
}
.pk-acc-dict-results {
    background: var(--pk-acc-card-bg, #f8fafc);
    border: 1px solid var(--pk-acc-card-border, #e2e8f0);
    border-radius: 8px;
    padding: 12px;
    font-size: 12.5px;
    line-height: 1.45;
    color: var(--pk-acc-text, #1e293b);
}
.pk-acc-dict-results h4 {
    margin: 0 0 6px 0;
    color: var(--pk-acc-text, #0f172a);
    font-size: 14px;
}
.pk-acc-dict-results a {
    color: var(--pk-acc-accent, #0f172a);
    text-decoration: underline;
    display: inline-block;
    margin-top: 6px;
    font-weight: 600;
}

/* Stepper Card */
.pk-acc-stepper-card {
    background: var(--pk-acc-card-bg, #f8fafc);
    border: 1px solid var(--pk-acc-card-border, #e2e8f0);
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.pk-acc-stepper-label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--pk-acc-text, #1e293b);
}
.pk-acc-stepper-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 220px;
    gap: 12px;
}
.pk-acc-step-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--pk-acc-accent, #0f172a);
    color: var(--pk-acc-accent-text, #ffffff);
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease;
    padding: 0;
    line-height: 1;
}
.pk-acc-step-btn:hover {
    opacity: 0.85;
    transform: scale(1.1);
}
.pk-acc-step-val {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--pk-acc-text, #1e293b);
    min-width: 80px;
    text-align: center;
}

/* 2-Column Grid Action Buttons */
.pk-acc-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.pk-acc-card-btn {
    background: var(--pk-acc-card-bg, #f8fafc);
    border: 1px solid var(--pk-acc-card-border, #e2e8f0);
    border-radius: 8px;
    padding: 14px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    color: var(--pk-acc-text, #1e293b);
    text-align: center;
    transition: all 0.18s ease;
    user-select: none;
}
.pk-acc-card-btn:hover {
    border-color: var(--pk-acc-accent, #0f172a);
    background: var(--pk-acc-sec-bg, #f1f5f9);
}
.pk-acc-card-btn.pk-acc-active {
    border-color: var(--pk-acc-accent, #0f172a);
    background: rgba(15, 23, 42, 0.08);
    box-shadow: 0 0 0 1px var(--pk-acc-accent, #0f172a);
}
.pk-acc-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--pk-acc-accent, #0f172a);
}
.pk-acc-card-icon svg {
    color: inherit;
    fill: currentColor;
}
.pk-acc-card-icon.pk-acc-icon-text {
    font-size: 20px;
    font-weight: 800;
    line-height: 1;
}
.pk-acc-card-icon.pk-acc-icon-badge {
    display: inline-block;
    border: 2px solid var(--pk-acc-accent, #0f172a);
    font-size: 13px;
    font-weight: 800;
    width: 22px;
    height: 22px;
    line-height: 18px;
    text-align: center;
    border-radius: 3px;
}
.pk-acc-card-text {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
}

/* Alignment Group */
.pk-acc-align-group {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
}
.pk-acc-align-btn {
    background: var(--pk-acc-card-bg, #f8fafc);
    border: 1px solid var(--pk-acc-card-border, #e2e8f0);
    border-radius: 8px;
    padding: 10px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    color: var(--pk-acc-text, #1e293b);
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    transition: all 0.15s ease;
}
.pk-acc-align-btn:hover {
    border-color: var(--pk-acc-accent, #0f172a);
    background: var(--pk-acc-sec-bg, #f1f5f9);
}
.pk-acc-align-btn.pk-acc-active {
    border-color: var(--pk-acc-accent, #0f172a);
    background: rgba(15, 23, 42, 0.08);
}
.pk-acc-align-btn svg {
    color: var(--pk-acc-accent, #0f172a);
}

/* Color Palettes */
.pk-acc-palette-box {
    background: var(--pk-acc-card-bg, #f8fafc);
    border: 1px solid var(--pk-acc-card-border, #e2e8f0);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.pk-acc-palette-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--pk-acc-text, #1e293b);
}
.pk-acc-palette-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.pk-acc-swatch {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    padding: 0;
}
.pk-acc-swatch:hover {
    transform: scale(1.2);
}
.pk-acc-swatch.pk-acc-active {
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px var(--pk-acc-accent, #0f172a);
    transform: scale(1.15);
}

/* Sticky Footer */
.pk-acc-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--pk-acc-border, #e2e8f0);
    background: var(--pk-acc-header-bg, #f8fafc);
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
}
.pk-acc-footer-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.pk-acc-footer-btn {
    border: 1px solid var(--pk-acc-accent, #0f172a);
    background: transparent;
    color: var(--pk-acc-accent, #0f172a);
    padding: 9px 8px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s ease;
}
.pk-acc-footer-btn:hover {
    background: var(--pk-acc-accent, #0f172a);
    color: var(--pk-acc-accent-text, #ffffff);
}
.pk-acc-footer-statement {
    text-align: center;
    font-size: 11.5px;
    color: var(--pk-acc-text-muted, #64748b);
}
.pk-acc-statement-link,
.pk-acc-statement-btn {
    color: var(--pk-acc-accent, #0f172a) !important;
    text-decoration: underline !important;
    font-weight: 600;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    font-size: inherit;
    font-family: inherit;
}

/* Statement Modal Dialog */
.pk-acc-statement-dialog {
    background: #ffffff;
    color: #1e293b;
    border-radius: 12px;
    width: 680px;
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    margin: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}
.pk-acc-statement-dialog .pk-acc-header {
    background: #0f172a;
    color: #ffffff;
    border-bottom: none;
}
.pk-acc-statement-content {
    padding: 24px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.6;
}
.pk-acc-statement-content h2,
.pk-acc-statement-content h3 {
    color: #0f172a;
    margin-top: 1em;
}

/* Reading Guide Line */
.pk-acc-reading-guide-line {
    position: fixed;
    left: 0;
    right: 0;
    height: 4px;
    background: #e50914;
    z-index: 99997;
    pointer-events: none;
    box-shadow: 0 0 10px rgba(229, 9, 20, 0.7);
}

/* Reading Mask Bands (Top & Bottom) */
.pk-acc-reading-mask-band,
#pk-acc-reading-mask-top,
#pk-acc-reading-mask-bottom {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    background: rgba(15, 23, 42, 0.75) !important;
    z-index: 99996 !important;
    pointer-events: none !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    transition: background-color 0.2s ease;
}
#pk-acc-reading-mask-top {
    border-bottom: 2px solid var(--pk-acc-accent, #e50914) !important;
}
#pk-acc-reading-mask-bottom {
    border-top: 2px solid var(--pk-acc-accent, #e50914) !important;
}

/* Ensure body pointer-events and normal layout are never hijacked by reading-mask active state */
body.pk-acc-reading-mask {
    position: static;
    pointer-events: auto !important;
}

/* Magnifier Bubble */
.pk-acc-magnifier-bubble {
    position: fixed;
    z-index: 99998;
    background: #ffffff;
    color: #0f172a;
    padding: 12px 18px;
    border: 2px solid #e50914;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    font-size: 24px !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;
    max-width: 480px;
    pointer-events: none;
}

/* =========================================================================
   Active Accessibility Classes applied to <html> or <body>
   ========================================================================= */

/* Content Scaling (Zoom Layout) */
body.pk-acc-scaled {
    zoom: var(--pk-acc-content-scale, 1) !important;
}
body.pk-acc-scaled #pk-acc-trigger,
body.pk-acc-scaled #pk-acc-panel-overlay {
    zoom: 1 !important;
}

/* Font Scaling */
body.pk-acc-font-scaled p,
body.pk-acc-font-scaled a,
body.pk-acc-font-scaled li,
body.pk-acc-font-scaled td,
body.pk-acc-font-scaled th,
body.pk-acc-font-scaled label,
body.pk-acc-font-scaled input,
body.pk-acc-font-scaled button:not(#pk-acc-trigger):not(.pk-acc-drawer *) {
    font-size: calc(1rem * var(--pk-acc-font-scale, 1)) !important;
}
body.pk-acc-font-scaled h1 { font-size: calc(2.2rem * var(--pk-acc-font-scale, 1)) !important; }
body.pk-acc-font-scaled h2 { font-size: calc(1.8rem * var(--pk-acc-font-scale, 1)) !important; }
body.pk-acc-font-scaled h3 { font-size: calc(1.5rem * var(--pk-acc-font-scale, 1)) !important; }
body.pk-acc-font-scaled h4 { font-size: calc(1.3rem * var(--pk-acc-font-scale, 1)) !important; }
body.pk-acc-font-scaled h5 { font-size: calc(1.1rem * var(--pk-acc-font-scale, 1)) !important; }
body.pk-acc-font-scaled h6 { font-size: calc(1rem * var(--pk-acc-font-scale, 1)) !important; }
body.pk-acc-line-height-active,
body.pk-acc-line-height-active p,
body.pk-acc-line-height-active li,
body.pk-acc-line-height-active article {
    line-height: var(--pk-acc-line-height, 1.8) !important;
}
body.pk-acc-spacing-active,
body.pk-acc-spacing-active p,
body.pk-acc-spacing-active a,
body.pk-acc-spacing-active span,
body.pk-acc-spacing-active li,
body.pk-acc-spacing-active h1,
body.pk-acc-spacing-active h2,
body.pk-acc-spacing-active h3 {
    letter-spacing: var(--pk-acc-letter-spacing, 0.08em) !important;
}

/* Alignments */
body.pk-acc-align-left,
body.pk-acc-align-left p,
body.pk-acc-align-left h1,
body.pk-acc-align-left h2,
body.pk-acc-align-left h3,
body.pk-acc-align-left h4,
body.pk-acc-align-left h5,
body.pk-acc-align-left h6,
body.pk-acc-align-left li {
    text-align: left !important;
}
body.pk-acc-align-center,
body.pk-acc-align-center p,
body.pk-acc-align-center h1,
body.pk-acc-align-center h2,
body.pk-acc-align-center h3,
body.pk-acc-align-center h4,
body.pk-acc-align-center h5,
body.pk-acc-align-center h6,
body.pk-acc-align-center li {
    text-align: center !important;
}
body.pk-acc-align-right,
body.pk-acc-align-right p,
body.pk-acc-align-right h1,
body.pk-acc-align-right h2,
body.pk-acc-align-right h3,
body.pk-acc-align-right h4,
body.pk-acc-align-right h5,
body.pk-acc-align-right h6,
body.pk-acc-align-right li {
    text-align: right !important;
}

/* Readable Font */
body.pk-acc-font-readable,
body.pk-acc-readable-font,
body.pk-acc-font-readable *,
body.pk-acc-readable-font * {
    font-family: Arial, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

/* Dyslexia Friendly Font */
body.pk-acc-font-dyslexia,
body.pk-acc-dyslexia-font,
body.pk-acc-font-dyslexia *,
body.pk-acc-dyslexia-font * {
    font-family: 'OpenDyslexic', 'Comic Sans MS', 'Comic Neue', sans-serif !important;
    letter-spacing: 0.04em !important;
    word-spacing: 0.08em !important;
}

/* Highlight Headings */
body.pk-acc-highlight-headings h1,
body.pk-acc-highlight-headings h2,
body.pk-acc-highlight-headings h3,
body.pk-acc-highlight-headings h4,
body.pk-acc-highlight-headings h5,
body.pk-acc-highlight-headings h6 {
    outline: 2px solid #e50914 !important;
    outline-offset: 3px !important;
    background-color: rgba(229, 9, 20, 0.06) !important;
}

/* Highlight Links */
body.pk-acc-highlight-links a:not(.pk-acc-trigger-btn):not(.pk-acc-skip-link):not(.pk-acc-footer-btn):not(.pk-acc-card-btn):not(.pk-acc-align-btn):not(.pk-acc-statement-link) {
    text-decoration: underline 3px #e50914 !important;
    background-color: rgba(229, 9, 20, 0.08) !important;
    color: #e50914 !important;
    font-weight: 700 !important;
}

/* High Contrast Focus */
body.pk-acc-high-focus *:focus-visible {
    outline: 3px solid #e50914 !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 4px #ffffff !important;
}

/* Contrast Modes */
html.pk-acc-dark-contrast,
body.pk-acc-dark-contrast {
    background-color: #121212 !important;
    color: #f8fafc !important;
}
body.pk-acc-dark-contrast p,
body.pk-acc-dark-contrast h1,
body.pk-acc-dark-contrast h2,
body.pk-acc-dark-contrast h3,
body.pk-acc-dark-contrast h4,
body.pk-acc-dark-contrast h5,
body.pk-acc-dark-contrast h6,
body.pk-acc-dark-contrast li,
body.pk-acc-dark-contrast span,
body.pk-acc-dark-contrast label,
body.pk-acc-dark-contrast td,
body.pk-acc-dark-contrast th {
    color: #f8fafc !important;
}
body.pk-acc-dark-contrast a:not(.pk-acc-trigger-btn):not(.pk-acc-card-btn):not(.pk-acc-footer-btn) {
    color: #38bdf8 !important;
}
body.pk-acc-dark-contrast main,
body.pk-acc-dark-contrast article,
body.pk-acc-dark-contrast section,
body.pk-acc-dark-contrast header,
body.pk-acc-dark-contrast footer,
body.pk-acc-dark-contrast div.site-content,
body.pk-acc-dark-contrast div.container {
    background-color: #121212 !important;
}

html.pk-acc-light-contrast,
body.pk-acc-light-contrast {
    background-color: #ffffff !important;
    color: #0f172a !important;
}
body.pk-acc-light-contrast p,
body.pk-acc-light-contrast h1,
body.pk-acc-light-contrast h2,
body.pk-acc-light-contrast h3,
body.pk-acc-light-contrast h4,
body.pk-acc-light-contrast h5,
body.pk-acc-light-contrast h6,
body.pk-acc-light-contrast li,
body.pk-acc-light-contrast span,
body.pk-acc-light-contrast label,
body.pk-acc-light-contrast td,
body.pk-acc-light-contrast th {
    color: #0f172a !important;
}
body.pk-acc-light-contrast a:not(.pk-acc-trigger-btn):not(.pk-acc-card-btn):not(.pk-acc-footer-btn) {
    color: #0284c7 !important;
}

/* Accessibility Filter Overlay (backdrop-filter) */
/* Using body::after backdrop-filter overlay prevents setting CSS 'filter' directly on html or body, preserving viewport-relative position: fixed for header, navbar, and modals */
body.pk-acc-monochrome::after,
body.pk-acc-high-contrast::after,
body.pk-acc-high-sat::after,
body.pk-acc-low-sat::after,
body.pk-acc-profile-epilepsy::after,
body.pk-acc-profile-visually-impaired::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none !important;
    z-index: 999999;
}

body.pk-acc-monochrome::after {
    backdrop-filter: grayscale(100%) !important;
    -webkit-backdrop-filter: grayscale(100%) !important;
}
body.pk-acc-high-contrast::after {
    backdrop-filter: contrast(160%) !important;
    -webkit-backdrop-filter: contrast(160%) !important;
}
body.pk-acc-high-sat::after {
    backdrop-filter: saturate(200%) !important;
    -webkit-backdrop-filter: saturate(200%) !important;
}
body.pk-acc-low-sat::after {
    backdrop-filter: saturate(40%) !important;
    -webkit-backdrop-filter: saturate(40%) !important;
}

/* Custom Text / Title / Background Colors */
body.pk-acc-custom-text,
body.pk-acc-custom-text p,
body.pk-acc-custom-text a,
body.pk-acc-custom-text span,
body.pk-acc-custom-text li {
    color: var(--pk-acc-text-color) !important;
}

body.pk-acc-custom-title h1,
body.pk-acc-custom-title h2,
body.pk-acc-custom-title h3,
body.pk-acc-custom-title h4,
body.pk-acc-custom-title h5,
body.pk-acc-custom-title h6 {
    color: var(--pk-acc-title-color) !important;
}

body.pk-acc-custom-bg {
    background-color: var(--pk-acc-bg-color) !important;
}

/* Stop Animations */
body.pk-acc-stop-animations,
body.pk-acc-stop-animations * {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
}

/* Hide Images */
body.pk-acc-hide-images img:not(.pk-acc-icon),
body.pk-acc-hide-images picture,
body.pk-acc-hide-images svg:not(.pk-acc-drawer *):not(#pk-acc-trigger *),
body.pk-acc-hide-images [style*="background-image"] {
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Hide Emoji */
body.pk-acc-hide-emoji img.emoji,
body.pk-acc-hide-emoji .wp-smiley {
    display: none !important;
}

/* Epilepsy Safe Profile */
body.pk-acc-profile-epilepsy::after {
    backdrop-filter: saturate(65%) !important;
    -webkit-backdrop-filter: saturate(65%) !important;
}
body.pk-acc-profile-epilepsy,
body.pk-acc-profile-epilepsy * {
    animation: none !important;
    transition: none !important;
}

/* Visually Impaired Profile */
body.pk-acc-profile-visually-impaired::after {
    backdrop-filter: contrast(130%) !important;
    -webkit-backdrop-filter: contrast(130%) !important;
}
body.pk-acc-profile-visually-impaired a {
    text-decoration: underline !important;
}

/* Cognitive Disability Profile */
body.pk-acc-profile-cognitive p:hover,
body.pk-acc-profile-cognitive li:hover,
body.pk-acc-profile-cognitive h1:hover,
body.pk-acc-profile-cognitive h2:hover,
body.pk-acc-profile-cognitive h3:hover {
    background-color: rgba(229, 9, 20, 0.08) !important;
    outline: 2px dashed #e50914 !important;
}

/* ADHD Friendly Profile */
body.pk-acc-profile-adhd,
body.pk-acc-profile-adhd * {
    animation: none !important;
}
