/* AllBlog shared service rail 2.0 */
.service-rail,
.service-rail * {
    box-sizing: border-box;
}

.service-rail {
    --rail-accent: var(--tool-accent, #22d3ee);
    --rail-accent-rgb: var(--tool-accent-rgb, 34, 211, 238);
    position: relative;
    display: grid;
    grid-template-columns: auto 46px minmax(0, 1fr) 46px;
    align-items: center;
    gap: 10px;
    margin: 24px 0 30px;
    padding: 12px;
    overflow: hidden;
    border: 1px solid rgba(151, 118, 255, .78);
    border-radius: 22px;
    background:
        radial-gradient(circle at 14% 0%, rgba(var(--rail-accent-rgb), .08), transparent 32%),
        linear-gradient(180deg, rgba(25, 27, 36, .97), rgba(17, 19, 27, .97));
    box-shadow: 0 18px 50px rgba(0, 0, 0, .14), inset 0 1px 0 rgba(255, 255, 255, .025);
}

[data-theme="light"] .service-rail {
    background:
        radial-gradient(circle at 14% 0%, rgba(var(--rail-accent-rgb), .07), transparent 34%),
        linear-gradient(180deg, rgba(255,255,255,.98), rgba(247,248,252,.98));
    box-shadow: 0 16px 36px rgba(33, 38, 55, .08);
}

.service-rail__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 5px 8px 5px 4px;
    color: var(--tool-text, #f4f4f7);
    text-decoration: none;
}

.service-rail__brand-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    border: 1px solid rgba(var(--rail-accent-rgb), .28);
    border-radius: 13px;
    background: rgba(var(--rail-accent-rgb), .10);
    font-size: 17px;
}

.service-rail__brand > span:last-child {
    display: grid;
    gap: 2px;
}

.service-rail__brand strong {
    font-size: 13px;
    line-height: 1.1;
}

.service-rail__brand small {
    color: var(--tool-meta, #7d8190);
    font-size: 9px;
    font-weight: 750;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.service-rail__window {
    position: relative;
    min-width: 0;
    padding-bottom: 9px;
}

.service-rail__viewport {
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
    touch-action: pan-x pan-y;
    position: relative;
    z-index: 3;
    cursor: grab;
    outline: none;
    -webkit-overflow-scrolling: touch;
}

.service-rail__viewport::-webkit-scrollbar {
    display: none;
}

.service-rail__viewport:focus-visible {
    border-radius: 14px;
    box-shadow: 0 0 0 3px rgba(var(--rail-accent-rgb), .16);
}

.service-rail__viewport.is-dragging {
    cursor: grabbing;
    user-select: none;
}

.service-rail__links {
    display: flex;
    align-items: center;
    width: max-content;
    min-width: 100%;
    gap: 8px;
    padding: 1px 3px 3px;
}

.service-rail__link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 9px 13px;
    flex: 0 0 auto;
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--tool-muted, #b2b4bf);
    text-decoration: none;
    font-size: 12px;
    font-weight: 800;
    position: relative;
    z-index: 1;
    cursor: pointer;
    pointer-events: auto;
    white-space: nowrap;
    transition: color .18s ease, border-color .18s ease, background .18s ease, transform .18s ease, box-shadow .18s ease;
}

.service-rail__link:hover {
    color: var(--tool-text, #fff);
    border-color: rgba(var(--rail-accent-rgb), .22);
    background: rgba(var(--rail-accent-rgb), .07);
}

.service-rail__link:active {
    transform: scale(.98);
}

.service-rail__link.is-active {
    color: var(--rail-accent);
    border-color: rgba(var(--rail-accent-rgb), .52);
    background: linear-gradient(135deg, rgba(var(--rail-accent-rgb), .17), rgba(var(--rail-accent-rgb), .08));
    box-shadow: 0 0 0 1px rgba(var(--rail-accent-rgb), .08), 0 10px 28px rgba(var(--rail-accent-rgb), .13);
}

.service-rail__link-icon {
    display: grid;
    place-items: center;
    min-width: 16px;
    font-size: 13px;
}

.service-rail__arrow {
    position: relative;
    z-index: 4;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 1px solid rgba(var(--rail-accent-rgb), .40);
    border-radius: 15px;
    background:
        linear-gradient(145deg, rgba(var(--rail-accent-rgb), .18), rgba(var(--rail-accent-rgb), .06)),
        var(--tool-surface-soft, #171923);
    color: var(--rail-accent);
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(var(--rail-accent-rgb), .10), inset 0 1px 0 rgba(255,255,255,.035);
    transition: transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease, opacity .18s ease;
}

.service-rail__arrow svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.service-rail__arrow:hover:not(:disabled) {
    transform: translateY(-1px) scale(1.03);
    border-color: rgba(var(--rail-accent-rgb), .78);
    background:
        linear-gradient(145deg, rgba(var(--rail-accent-rgb), .28), rgba(var(--rail-accent-rgb), .10)),
        var(--tool-surface-soft, #171923);
    box-shadow: 0 14px 32px rgba(var(--rail-accent-rgb), .18), 0 0 0 3px rgba(var(--rail-accent-rgb), .07);
}

.service-rail__arrow:active:not(:disabled) {
    transform: scale(.96);
}

.service-rail__arrow:disabled {
    opacity: .42;
    cursor: default;
    filter: saturate(.45);
    box-shadow: none;
}

.service-rail__edge {
    position: absolute;
    z-index: 2;
    top: 0;
    bottom: 8px;
    width: 38px;
    pointer-events: none;
    opacity: 1;
    transition: opacity .2s ease;
}

.service-rail__edge--left {
    left: 0;
    background: linear-gradient(90deg, rgba(17,19,27,.98), rgba(17,19,27,0));
}

.service-rail__edge--right {
    right: 0;
    background: linear-gradient(270deg, rgba(17,19,27,.98), rgba(17,19,27,0));
}

[data-theme="light"] .service-rail__edge--left {
    background: linear-gradient(90deg, rgba(250,250,252,.98), rgba(250,250,252,0));
}

[data-theme="light"] .service-rail__edge--right {
    background: linear-gradient(270deg, rgba(250,250,252,.98), rgba(250,250,252,0));
}

.service-rail.is-at-start .service-rail__edge--left,
.service-rail.is-at-end .service-rail__edge--right {
    opacity: 0;
}

.service-rail__progress {
    position: absolute;
    left: 4px;
    right: 4px;
    bottom: 0;
    height: 4px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255,255,255,.055);
    cursor: pointer;
}

[data-theme="light"] .service-rail__progress {
    background: rgba(23,26,38,.08);
}

.service-rail__progress[hidden] { display: none !important; }

.service-rail__progress-thumb {
    position: absolute;
    top: 0;
    left: 0;
    width: 40px;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--rail-accent), #a78bfa);
    box-shadow: 0 0 12px rgba(var(--rail-accent-rgb), .38);
    transform: translateX(0);
    cursor: grab;
}

.service-rail__progress-thumb.is-dragging {
    cursor: grabbing;
}

.service-rail__hint {
    display: none;
    align-items: center;
    gap: 5px;
    padding-right: 3px;
    color: var(--tool-meta, #7d8190);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    white-space: nowrap;
}

.service-rail__hint > span {
    color: var(--rail-accent);
    font-size: 14px;
}

@media (max-width: 980px) {
    .service-rail {
        grid-template-columns: 42px minmax(0, 1fr) 42px;
        gap: 8px;
    }

    .service-rail__brand,
    .service-rail__hint {
        display: none;
    }

    .service-rail__arrow {
        width: 42px;
        height: 42px;
        border-radius: 14px;
    }
}

@media (max-width: 560px) {
    .service-rail {
        grid-template-columns: 38px minmax(0, 1fr) 38px;
        margin: 18px 0 24px;
        padding: 9px;
        border-radius: 18px;
    }

    .service-rail__arrow {
        width: 38px;
        height: 38px;
        border-radius: 12px;
    }

    .service-rail__arrow svg {
        width: 18px;
        height: 18px;
    }

    .service-rail__link {
        min-height: 38px;
        padding: 8px 11px;
        font-size: 11px;
    }

    .service-rail__edge {
        width: 24px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .service-rail__link,
    .service-rail__arrow,
    .service-rail__edge {
        transition: none;
    }
}
