:root {
    --ey-slider-accent: #2563eb;
    --ey-slider-accent-dark: #1d4ed8;
    --ey-slider-success: #16834a;
    --ey-slider-error: #c93737;
    --ey-slider-text: #172033;
    --ey-slider-muted: #667085;
    --ey-slider-border: #d8dee9;
    --ey-slider-surface: #ffffff;
}

body.ey-slider-modal-open {
    overflow: hidden;
}

.ey-slider-overlay,
.ey-slider-overlay * {
    box-sizing: border-box;
}

.ey-slider-overlay[hidden] {
    display: none !important;
}

.ey-slider-overlay {
    position: fixed;
    z-index: 99999;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    overflow-y: auto;
    background: rgba(15, 23, 42, 0.58);
    opacity: 0;
    transition: opacity 180ms ease-out;
}

.ey-slider-overlay.is-open {
    opacity: 1;
}

.ey-slider-modal {
    width: min(364px, calc(100vw - 24px));
    max-height: calc(100dvh - 24px);
    overflow: auto;
    color: var(--ey-slider-text);
    background: var(--ey-slider-surface);
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 16px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
    transform: translateY(8px) scale(0.985);
    transition: transform 200ms ease-out;
}

.ey-slider-overlay.is-open .ey-slider-modal {
    transform: translateY(0) scale(1);
}

.ey-slider-modal-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 18px 15px;
    border-bottom: 1px solid #edf0f5;
}

.ey-slider-modal-title h2 {
    margin: 0;
    color: var(--ey-slider-text);
    font: 700 18px/1.3 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

.ey-slider-modal-title p {
    margin: 5px 0 0;
    color: var(--ey-slider-muted);
    font: 400 13px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.ey-slider-close,
.ey-slider-thumb,
.ey-slider-refresh {
    appearance: none;
    -webkit-appearance: none;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.ey-slider-close {
    display: grid;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    margin: -8px -8px 0 0;
    padding: 10px;
    place-items: center;
    color: #667085;
    background: transparent;
    border: 0;
    border-radius: 10px;
    cursor: pointer;
}

.ey-slider-close:hover {
    color: #172033;
    background: #f2f4f7;
}

.ey-slider-close svg,
.ey-slider-thumb svg,
.ey-slider-refresh svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.ey-slider-close:focus-visible,
.ey-slider-thumb:focus-visible,
.ey-slider-refresh:focus-visible,
.ey-slider-alternative:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.35);
    outline-offset: 2px;
}

.ey-slider-modal-body {
    padding: 18px;
}

.ey-slider-puzzle {
    position: relative;
    width: 100%;
    aspect-ratio: 300 / 168;
    margin-bottom: 15px;
    overflow: hidden;
    background: #e8edf4;
    border: 1px solid rgba(15, 23, 42, 0.14);
    border-radius: 10px;
}

.ey-slider-puzzle-background {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: fill;
    user-select: none;
    -webkit-user-drag: none;
}

.ey-slider-puzzle-block {
    position: absolute;
    z-index: 2;
    left: 0;
    width: 48px;
    height: 48px;
    filter: drop-shadow(0 3px 5px rgba(15, 23, 42, 0.55));
    user-select: none;
    will-change: transform;
    pointer-events: none;
    -webkit-user-drag: none;
}

.ey-slider-loader {
    position: absolute;
    z-index: 3;
    inset: 0;
    display: none;
    background: linear-gradient(105deg, #e7ebf1 20%, #f8fafc 38%, #e7ebf1 56%);
    background-size: 220% 100%;
    animation: ey-slider-loading 1.15s linear infinite;
}

.ey-slider-puzzle.is-loading .ey-slider-loader {
    display: block;
}

@keyframes ey-slider-loading {
    to {
        background-position-x: -220%;
    }
}

.ey-slider-track {
    position: relative;
    height: 50px;
    overflow: hidden;
    background: #f3f5f8;
    border: 1px solid var(--ey-slider-border);
    border-radius: 12px;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
    user-select: none;
    touch-action: none;
}

.ey-slider-track.is-disabled,
.ey-slider-track.is-checking {
    opacity: 0.7;
}

.ey-slider-fill {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.2), rgba(37, 99, 235, 0.08));
    transform: scaleX(0);
    transform-origin: left center;
    will-change: transform;
}

.ey-slider-thumb {
    position: absolute;
    z-index: 2;
    top: 0;
    left: 0;
    display: grid;
    width: 48px;
    height: 48px;
    padding: 0;
    place-items: center;
    color: #fff;
    background: var(--ey-slider-accent);
    border: 0;
    border-radius: 11px;
    box-shadow: 0 3px 9px rgba(37, 99, 235, 0.32);
    cursor: grab;
    touch-action: none;
    will-change: transform;
}

.ey-slider-thumb:active,
.ey-slider-track.is-dragging .ey-slider-thumb {
    background: var(--ey-slider-accent-dark);
    cursor: grabbing;
}

.ey-slider-thumb:disabled {
    cursor: not-allowed;
}

.ey-slider-hint {
    position: absolute;
    top: 50%;
    left: calc(50% + 12px);
    max-width: calc(100% - 74px);
    overflow: hidden;
    color: #7b8495;
    font: 500 14px/1.2 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    text-overflow: ellipsis;
    white-space: nowrap;
    transform: translate(-50%, -50%);
    transition: opacity 120ms ease-out;
    pointer-events: none;
}

.ey-slider-status {
    min-height: 21px;
    margin: 10px 2px 0;
    color: var(--ey-slider-muted);
    font: 500 13px/1.55 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.ey-slider-status.is-error {
    color: var(--ey-slider-error);
}

.ey-slider-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 5px;
}

.ey-slider-keyboard {
    color: #7b8495;
    font: 400 11px/1.4 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.ey-slider-refresh {
    display: inline-flex;
    min-width: 44px;
    min-height: 44px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 7px 9px;
    color: var(--ey-slider-accent-dark);
    background: transparent;
    border: 0;
    border-radius: 9px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
}

.ey-slider-refresh:hover {
    background: #eff5ff;
}

.ey-slider-refresh:disabled {
    color: #9aa2af;
    cursor: not-allowed;
}

.ey-slider-refresh svg {
    width: 17px;
    height: 17px;
}

.ey-slider-alternative {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    margin-top: 3px;
    color: var(--ey-slider-accent-dark);
    font: 600 12px/1.4 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.ey-slider-alternative[hidden] {
    display: none !important;
}

.ey-slider-success {
    border-color: rgba(22, 131, 74, 0.55);
}

.ey-slider-success .ey-slider-fill {
    background: rgba(22, 131, 74, 0.17);
}

.ey-slider-success .ey-slider-thumb {
    color: #fff;
    background: var(--ey-slider-success);
    box-shadow: 0 3px 9px rgba(22, 131, 74, 0.28);
}

.ey-slider-fail {
    border-color: rgba(201, 55, 55, 0.55);
}

.ey-slider-fail .ey-slider-fill {
    background: rgba(201, 55, 55, 0.12);
}

.ey-slider-fail .ey-slider-thumb {
    background: var(--ey-slider-error);
    box-shadow: 0 3px 9px rgba(201, 55, 55, 0.24);
}

@media (max-width: 380px) {
    .ey-slider-modal-title,
    .ey-slider-modal-body {
        padding-right: 14px;
        padding-left: 14px;
    }

    .ey-slider-keyboard {
        max-width: 190px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ey-slider-overlay,
    .ey-slider-modal,
    .ey-slider-hint {
        transition: none;
    }

    .ey-slider-loader {
        animation: none;
    }
}
