.rl-ui [hidden],
.rl-a11y__panel[hidden],
.rl-consent[hidden],
.rl-guide[hidden] {
    display: none !important;
}

.skip-link.screen-reader-text:focus,
.skip-link:focus {
    position: fixed !important;
    top: 8px !important;
    right: 8px !important;
    left: auto !important;
    width: auto !important;
    height: auto !important;
    clip: auto !important;
    clip-path: none !important;
    overflow: visible !important;
    z-index: 100002 !important;
    background: #111 !important;
    color: #fff !important;
    padding: 12px 18px !important;
    font-size: 18px !important;
    line-height: 1.3 !important;
    text-decoration: none !important;
    border-radius: 8px;
}

:focus-visible {
    outline: 3px solid #9d1c1c;
    outline-offset: 2px;
}

html[data-rl-filter] body {
    filter: var(--rl-filter);
}

html.rl-invert img,
html.rl-invert video,
html.rl-invert picture,
html.rl-invert .rl-ui {
    filter: invert(1) hue-rotate(180deg);
}

html.rl-readable body,
html.rl-readable button,
html.rl-readable input,
html.rl-readable textarea,
html.rl-readable select {
    font-family: Arial, "Arial Hebrew", "Noto Sans Hebrew", sans-serif !important;
}

html.rl-links a:not(.rl-btn):not(.rl-a11y__statement):not(.rl-legal__button) {
    text-decoration: underline !important;
    background-color: #fff3a0 !important;
    color: #111 !important;
    outline: 2px solid #111;
    outline-offset: 1px;
}

html.rl-headings :is(h1, h2, h3, h4, h5, h6) {
    outline: 3px solid #9d1c1c !important;
    outline-offset: 3px;
}

html.rl-spacing :is(p, li, h1, h2, h3, h4, h5, h6, td, th, label) {
    line-height: 1.9 !important;
    letter-spacing: 0.04em !important;
    word-spacing: 0.08em !important;
}

html.rl-contrast,
html.rl-contrast body,
html.rl-contrast body *:not(img):not(svg):not(video):not(canvas):not(path):not(circle):not(.rl-ui):not(.rl-ui *) {
    background-color: #000 !important;
    color: #fff !important;
    border-color: #fff !important;
    box-shadow: none !important;
}

html.rl-contrast a {
    color: #ffe14a !important;
    text-decoration: underline !important;
}

html.rl-contrast .rl-ui,
html.rl-contrast .rl-ui * {
    background-color: #161616 !important;
    color: #fff !important;
    border-color: #555 !important;
}

html[data-rl-motion="off"] *:not(.rl-ui):not(.rl-ui *),
html[data-rl-motion="off"] *:not(.rl-ui):not(.rl-ui *)::before,
html[data-rl-motion="off"] *:not(.rl-ui):not(.rl-ui *)::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
}

@media (prefers-reduced-motion: reduce) {
    html:not([data-rl-motion="on"]) *:not(.rl-ui):not(.rl-ui *) {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

.rl-ui {
    font-family: Arial, "Arial Hebrew", "Noto Sans Hebrew", sans-serif;
    letter-spacing: 0;
    word-spacing: 0;
    line-height: 1.45;
}

.rl-a11y {
    position: fixed;
    z-index: 100000 !important;
    bottom: calc(16px + var(--rl-banner-h, 0px));
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

body:has(#rl-consent:not([hidden])) #ht-ctc-chat {
    bottom: calc(20px + var(--rl-banner-h, 240px)) !important;
}

.rl-a11y--left { left: 16px; right: auto; }
.rl-a11y--right { right: 16px; left: auto; align-items: flex-end; }

.rl-a11y__toggle,
.rl-btn,
.rl-a11y__grid button,
.rl-a11y__size button,
.rl-a11y__reset,
.rl-a11y__close,
.rl-legal__button,
.rl-consent__close {
    font: inherit;
    cursor: pointer;
}

button.rl-a11y__toggle {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    padding: 10px 16px;
    border: 0 !important;
    border-radius: 999px;
    background: #9d1c1c !important;
    color: #fff !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.rl-a11y__toggle:hover,
.rl-a11y__toggle:focus-visible { background: #7d1414; }

.rl-a11y__panel {
    width: min(340px, calc(100vw - 32px));
    max-height: min(70vh, 640px);
    overflow: auto;
    padding: 16px;
    border: 1px solid #e4e4e4;
    border-radius: 16px;
    background: #fff;
    color: #161616;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.16);
}

.rl-a11y__head,
.rl-a11y__size {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.rl-a11y__head h2,
.rl-consent h2,
.rl-doc h1 {
    margin: 0;
    font-size: 1.15rem;
    line-height: 1.3;
}

.rl-a11y__close,
.rl-consent__close {
    border: 0;
    background: transparent;
    color: #333;
    text-decoration: underline;
    min-height: 44px;
}

.rl-a11y__size { margin: 12px 0; }
.rl-a11y__size button,
.rl-a11y__grid button,
.rl-a11y__reset {
    border: 1px solid #d0d0d0;
    background: #fafafa;
    color: #161616;
    border-radius: 10px;
    min-height: 44px;
}

.rl-a11y__size button { width: 48px; font-size: 1.05rem; }
.rl-a11y__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.rl-a11y__grid button { padding: 8px; }
.rl-a11y__grid button[aria-pressed="true"],
.rl-a11y__size button[aria-pressed="true"] {
    background: #9d1c1c;
    color: #fff;
    border-color: #9d1c1c;
}
.rl-a11y__reset,
.rl-a11y__statement {
    display: block;
    width: 100%;
    margin-top: 10px;
    text-align: center;
}
.rl-a11y__statement { color: #9d1c1c; min-height: 44px; line-height: 44px; }

.rl-guide {
    position: fixed;
    left: 0;
    right: 0;
    height: 32px;
    margin-top: -16px;
    background: rgba(255, 214, 0, 0.35);
    border-top: 2px solid #111;
    border-bottom: 2px solid #111;
    pointer-events: none;
    z-index: 99990;
}

.rl-consent {
    position: fixed;
    z-index: 100001;
    left: 50%;
    right: auto;
    bottom: 14px;
    width: min(680px, calc(100% - 20px));
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.96);
    color: #2a2a2a;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 14px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
}

.rl-consent__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 16px 18px 14px;
    text-align: center;
}
.rl-consent__notice {
    margin: 0;
    max-width: 42rem;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #2c2c2c;
}
.rl-consent__policy { margin: 0; }
.rl-consent__policy a {
    color: #7a2458;
    font-size: 0.95rem;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.rl-consent__actions {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 8px;
    margin: 2px 0 0;
}
.rl-consent .rl-btn {
    min-height: 36px;
    min-width: 96px;
    padding: 6px 16px;
    border-radius: 999px;
    border: 1px solid #e2e2e2;
    background: #fff;
    color: #333;
    font-size: 0.82rem;
    flex: 0 0 auto;
    box-shadow: none;
}
.rl-consent .rl-btn--primary { background: #3f3f3f; color: #fff; border-color: #3f3f3f; }
.rl-consent .rl-btn--primary:hover,
.rl-consent .rl-btn--primary:focus-visible { background: #222; }
.rl-consent .rl-btn--ghost:hover,
.rl-consent .rl-btn--ghost:focus-visible { background: #f4f4f4; }

.rl-consent__custom {
    width: 100%;
    margin-top: 4px;
    padding-top: 12px;
    border-top: 1px solid #eee;
    text-align: right;
}
.rl-consent__custom fieldset { border: 0; margin: 0 0 10px; padding: 0; }
.rl-consent__custom legend { font-weight: 700; margin-bottom: 8px; }
.rl-check {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin: 8px 0;
}
.rl-check input { width: 1.15rem; height: 1.15rem; margin-top: 0.15rem; }

.rl-legal {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 18px;
    padding: 14px 16px 18px;
    background: #f6f6f6;
    color: #222;
    border-top: 1px solid #e5e5e5;
}
.rl-legal a,
.rl-legal__button {
    color: #222;
    background: transparent;
    border: 0;
    text-decoration: underline;
    min-height: 44px;
    padding: 8px 2px;
}

.rl-doc { max-width: 760px; margin: 24px auto 48px; padding: 0 16px; color: #161616; }
.rl-doc h1 { font-size: 2rem; margin-bottom: 8px; }
.rl-doc h2 { font-size: 1.25rem; margin: 1.4em 0 0.4em; }
.rl-doc p, .rl-doc li { font-size: 1.05rem; line-height: 1.7; }
.rl-doc__meta { color: #444; }
.rl-doc__table-wrap { overflow-x: auto; margin: 12px 0 20px; }
.rl-doc__table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.rl-doc__table th,
.rl-doc__table td { border: 1px solid #ddd; padding: 8px 10px; text-align: right; vertical-align: top; }
.rl-doc__table th { background: #f6f6f6; }
.rl-doc code { font-size: 0.9em; }

@media (max-width: 640px) {
    .rl-a11y__grid { grid-template-columns: 1fr; }
    .rl-consent { bottom: 10px; width: calc(100% - 16px); }
    .rl-consent .rl-btn { padding: 6px 14px; }
    .rl-consent:has(.rl-consent__extra:not([hidden])) .rl-consent__actions,
    .rl-consent:has(.rl-consent__custom:not([hidden])) .rl-consent__actions {
        width: 100%;
    }
}
