:root {
    --ail-primary: #6c3cff;
    --ail-primary-2: #9b5cff;
    --ail-blue: #2f7cff;
    --ail-cyan: #27c3d9;
    --ail-pink: #e95dff;
    --ail-text: #1f2937;
    --ail-muted: #667085;
    --ail-card: rgba(255, 255, 255, 0.82);
    --ail-border: rgba(120, 92, 255, 0.16);
    --ail-shadow: 0 24px 70px rgba(48, 36, 120, 0.22);
}

/* כפתור פתיחה */

.ail-toggle {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 999999;
    width: var(--ail-toggle-size, 58px);
    height: var(--ail-toggle-size, 58px);
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    background: linear-gradient(135deg, var(--ail-primary), var(--ail-primary-2), var(--ail-blue)) !important;
    color: #fff !important;
    box-shadow: 0 14px 34px rgba(108, 60, 255, 0.38);
    display: flex;
    align-items: center;
    justify-content: center;
    isolation: isolate;
}

.ail-toggle::before,
.ail-toggle::after {
    content: "";
    position: absolute;
    inset: -9px;
    border-radius: 50%;
    border: 1px solid rgba(108, 60, 255, 0.35);
    animation: ail-pulse 2.4s ease-out 1;
    z-index: -1;
}

.ail-toggle::before {
    animation-fill-mode: forwards;
}

.ail-toggle::after {
    inset: -18px;
    opacity: 0.55;
    animation-delay: 0.7s;
    animation-fill-mode: forwards;
}

.ail-toggle:hover {
    transform: translateY(-2px) scale(1.04);
}

.ail-toggle-icon {
    display: flex;
}

.ail-toggle.ail-position-bottom-right {
    right: 24px;
    left: auto;
    bottom: 24px;
    top: auto;
}

.ail-toggle.ail-position-bottom-left {
    left: 24px;
    right: auto;
    bottom: 24px;
    top: auto;
}

.ail-toggle.ail-position-top-right {
    right: 24px;
    left: auto;
    top: 24px;
    bottom: auto;
}

.ail-toggle.ail-position-top-left {
    left: 24px;
    right: auto;
    top: 24px;
    bottom: auto;
}

.ail-toggle svg {
    width: calc(var(--ail-toggle-size, 58px) * 0.45);
    height: calc(var(--ail-toggle-size, 58px) * 0.45);
}

.ail-panel.ail-position-bottom-right {
    right: 24px;
    left: auto;
    bottom: 96px;
    top: auto;
}

.ail-panel.ail-position-bottom-left {
    left: 24px;
    right: auto;
    bottom: 96px;
    top: auto;
}

.ail-panel.ail-position-top-right {
    right: 24px;
    left: auto;
    top: 96px;
    bottom: auto;
}

.ail-panel.ail-position-top-left {
    left: 24px;
    right: auto;
    top: 96px;
    bottom: auto;
}

@keyframes ail-pulse {
    0% {
        transform: scale(0.9);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.18);
        opacity: 0;
    }
}

/* פאנל */

.ail-panel {
    position: fixed;
    right: 24px;
    bottom: 112px;
    z-index: 999999;
    width: 620px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    direction: rtl;
    color: var(--ail-text);
    padding: 24px;
    border-radius: 28px;
    background:
        radial-gradient(circle at 15% 15%, rgba(233, 93, 255, 0.14), transparent 35%),
        radial-gradient(circle at 85% 25%, rgba(47, 124, 255, 0.13), transparent 34%),
        rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(255, 255, 255, 0.65);
    box-shadow: var(--ail-shadow);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(18px) scale(0.96);
    transition: 0.28s ease;
}

.ail-panel.ail-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.ail-panel-header {
    display: grid;
    grid-template-columns: 90px 1fr 48px;
    align-items: start;
    gap: 12px;
    margin-bottom: 24px;
}

.ail-reset-top,
.ail-close {
    border: 0;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.9);
    color: var(--ail-text);
    box-shadow: 0 10px 25px rgba(31, 41, 55, 0.12);
}

.ail-reset-top {
    width: 62px;
    height: 62px;
    border-radius: 20px;
    font-size: 28px;
    line-height: 1;
}

.ail-reset-top span {
    display: block;
    font-size: 12px;
    margin-top: 2px;
    white-space: nowrap;
}

.ail-close {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 34px;
    line-height: 40px;
}

.ail-title-wrap {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 12px;
    text-align: center;
}

.ail-title-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ail-primary), var(--ail-blue));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 26px rgba(108, 60, 255, 0.35);
}

.ail-title-wrap h2 {
    margin: 0;
    font-size: 30px;
    font-weight: 800;
    color: var(--ail-text);
}

.ail-title-wrap p {
    margin: 6px 0 0;
    color: var(--ail-muted);
    font-size: 15px;
}

/* כרטיסים */

.ail-actions-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.ail-card {
    min-height: 128px;
    border: 1px solid var(--ail-border);
    border-radius: 20px;
    background: var(--ail-card);
    color: #111827;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(31, 41, 55, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    font-size: 15px;
    font-weight: 700;
    transition: 0.22s ease;
}

.ail-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 42px rgba(108, 60, 255, 0.18);
}

.ail-card.ail-active {
    background: linear-gradient(135deg, rgba(108, 60, 255, 0.14), rgba(47, 124, 255, 0.1));
    border-color: rgba(108, 60, 255, 0.45);
    box-shadow: 0 18px 42px rgba(108, 60, 255, 0.22);
}

.ail-card-icon {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: rgba(108, 60, 255, 0.1);
    color: var(--ail-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 31px;
    line-height: 1;
}

/* סליידרים */

.ail-controls {
    margin-top: 22px;
    padding: 18px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(108, 60, 255, 0.12);
    box-shadow: 0 14px 35px rgba(31, 41, 55, 0.08);
}

.ail-control + .ail-control {
    margin-top: 18px;
}

.ail-control-title {
    display: grid;
    grid-template-columns: 42px 1fr 60px;
    align-items: center;
    gap: 10px;
    font-size: 15px;
}

.ail-badge {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ail-primary), var(--ail-primary-2));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
}

.ail-range-row {
    display: grid;
    grid-template-columns: 52px 1fr 52px;
    align-items: center;
    gap: 14px;
    margin-top: 8px;
    direction: ltr;
}

.ail-range-row button {
    border: 0;
    background: transparent;
    color: #111827;
    font-size: 22px;
    font-weight: 800;
    cursor: pointer;
}

.ail-range-row input[type="range"] {
    width: 100%;
    accent-color: var(--ail-primary);
}

.ail-footer {
    margin-top: 20px;
    text-align: center;
    color: #5b6475;
    font-size: 15px;
}

/* מדריך קריאה */

.ail-reading-line {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    height: 42px;
    pointer-events: none;
    z-index: 999998;
    background: rgba(108, 60, 255, 0.16);
    border-top: 2px solid rgba(108, 60, 255, 0.45);
    border-bottom: 2px solid rgba(108, 60, 255, 0.45);
}

body.ail-reading-guide .ail-reading-line {
    display: block;
}

/* אפקטים על האתר */

body.ail-high-contrast *:not(#wpadminbar):not(#wpadminbar *):not(.ail-toggle):not(.ail-toggle *):not(.ail-panel):not(.ail-panel *):not(.ail-statement-modal):not(.ail-statement-modal *) {
    background-color: #000 !important;
    color: #fff !important;
    border-color: #fff !important;
}

body.ail-high-contrast a:not(.ail-statement-link):not(.ail-panel a):not(.ail-statement-modal a) {
    color: #ffff00 !important;
}

body.ail-high-contrast a {
    color: #ffff00 !important;
}

body.ail-invert .ail-site-wrapper {
    filter: invert(1);
}

body.ail-invert .ail-site-wrapper img,
body.ail-invert .ail-site-wrapper video,
body.ail-invert .ail-site-wrapper iframe {
    filter: invert(1);
}

body.ail-grayscale .ail-site-wrapper {
    filter: grayscale(1);
}

body.ail-highlight-links a {
    text-decoration: underline !important;
    text-decoration-thickness: 3px !important;
    text-underline-offset: 4px !important;
    font-weight: 800 !important;
    outline: 2px solid currentColor !important;
    outline-offset: 3px !important;
}

body.ail-readable-font,
body.ail-readable-font *:not(.ail-panel):not(.ail-panel *) {
    font-family: Arial, Helvetica, sans-serif !important;
}

body.ail-no-animations *,
body.ail-no-animations *::before,
body.ail-no-animations *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
}

body.ail-hide-images img,
body.ail-hide-images picture,
body.ail-hide-images video,
body.ail-hide-images iframe {
    visibility: hidden !important;
}

body.ail-large-dark-cursor,
body.ail-large-dark-cursor * {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cpath d='M8 4 L38 26 L25 29 L31 43 L25 46 L19 32 L10 40 Z' fill='black' stroke='white' stroke-width='2'/%3E%3C/svg%3E") 4 4, auto !important;
}

body.ail-large-light-cursor,
body.ail-large-light-cursor * {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cpath d='M8 4 L38 26 L25 29 L31 43 L25 46 L19 32 L10 40 Z' fill='white' stroke='black' stroke-width='2'/%3E%3C/svg%3E") 4 4, auto !important;
}

.ail-statement-link {
    border: 0;
    background: transparent;
    color: var(--ail-primary);
    font-weight: 800;
    cursor: pointer;
    text-decoration: underline;
    font-size: 15px;
}

.ail-statement-modal {
    position: fixed;
    inset: 0;
    z-index: 1000000;
    background: rgba(17, 24, 39, 0.42);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ail-statement-modal.ail-open {
    display: flex;
}

.ail-statement-box {
    width: 720px;
    max-width: 100%;
    max-height: 82vh;
    overflow-y: auto;
    background: #ffffff;
    color: #1f2937;
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
    position: relative;
}

.ail-statement-close {
    position: sticky;
    top: 0;
    margin-right: auto;
    display: block;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: #f3f4f6;
    color: #111827;
    font-size: 30px;
    cursor: pointer;
}

.ail-statement-content h2,
.ail-statement-content h3 {
    color: #111827;
}

.ail-statement-content p {
    line-height: 1.8;
    font-size: 16px;
}

.ail-footer-heart {
    font-size: 16px !important;
    line-height: 1;
    display: inline-block;
    vertical-align: middle;
}

/* מובייל */

@media (max-width: 720px) {
    .ail-panel {
        right: 12px;
        left: 12px;
        bottom: 96px;
        width: auto;
        max-height: calc(100vh - 120px);
        padding: 18px;
        border-radius: 24px;
    }

    .ail-panel-header {
        grid-template-columns: 44px minmax(0, 1fr) 44px !important;
    }

    .ail-title-wrap h2 {
        font-size: 22px;
    }

    .ail-title-wrap p {
        font-size: 13px;
    }

    .ail-actions-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .ail-card {
        min-height: 96px;
        font-size: 13px;
    }

    .ail-card-icon {
        width: 46px;
        height: 46px;
        font-size: 24px;
    }

    .ail-toggle {
        width: 64px;
        height: 64px;
        right: 18px;
        bottom: 18px;
        background: linear-gradient(135deg, var(--ail-primary), var(--ail-primary-2), var(--ail-blue)) !important;
        color: #fff !important;
    }

    .ail-panel.ail-position-bottom-right,
    .ail-panel.ail-position-bottom-left {
        right: 12px;
        left: 12px;
        bottom: 88px;
        top: auto;
    }

    .ail-panel.ail-position-top-right,
    .ail-panel.ail-position-top-left {
        right: 12px;
        left: 12px;
        top: 88px;
        bottom: auto;
    }

    .ail-toggle.ail-position-bottom-right {
        right: 18px;
        left: auto;
        bottom: 18px;
    }

    .ail-toggle.ail-position-bottom-left {
        left: 18px;
        right: auto;
        bottom: 18px;
    }

    .ail-toggle.ail-position-top-right {
        right: 18px;
        left: auto;
        top: 18px;
    }

    .ail-toggle.ail-position-top-left {
        left: 18px;
        right: auto;
        top: 18px;
    }
}

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

.ail-toggle,
.ail-toggle::before,
.ail-toggle::after,
.ail-panel,
.ail-statement-modal {
    box-sizing: border-box;
}

@media (max-width: 720px) {
    .ail-toggle::before,
    .ail-toggle::after {
        display: none !important;
    }

    .ail-panel {
        width: auto !important;
        max-width: none !important;
        right: 12px !important;
        left: 12px !important;
        transform-origin: bottom center;
    }

    .ail-panel.ail-position-top-right,
    .ail-panel.ail-position-top-left {
        right: 12px !important;
        left: 12px !important;
    }

    .ail-panel.ail-position-bottom-right,
    .ail-panel.ail-position-bottom-left {
        right: 12px !important;
        left: 12px !important;
    }

    .ail-actions-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .ail-card,
    .ail-control,
    .ail-controls {
        min-width: 0 !important;
        max-width: 100% !important;
    }
}