html {
    overflow-y: auto;
    scrollbar-gutter: stable;
}

body.has-action-rail {
    padding: 18px 18px 32px 84px;
    box-sizing: border-box;
}

.action-rail {
    position: fixed;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1200;
}

.rail-link,
.rail-button {
    width: 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.94);
    color: #1f2937;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.14);
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
    position: relative;
    padding: 0;
}

.rail-link:hover,
.rail-button:hover {
    transform: translateX(2px);
    background: #111827;
    color: #fff;
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.22);
}

.rail-link.danger:hover {
    background: #b91c1c;
}

.rail-link svg,
.rail-button svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.rail-link::after,
.rail-button::after {
    content: attr(data-label);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(17, 24, 39, 0.94);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
}

.rail-link:hover::after,
.rail-button:hover::after {
    opacity: 1;
}

@media (max-width: 960px) {
    body.has-action-rail {
        padding: 12px 12px 82px;
    }

    .action-rail {
        left: 12px;
        right: 12px;
        top: auto;
        bottom: 14px;
        transform: none;
        flex-direction: row;
        justify-content: center;
    }

    .rail-link::after,
    .rail-button::after {
        display: none;
    }
}
