.header-wrapper.sticky-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: none;
    height: 56px;
    padding: 12px;
    position: sticky;
    top: 0;
    z-index: 5;
    background-color: var(--ds-surface, #ffffff);
    color: var(--ds-text, #172b4d);
    border-bottom: var(--ds-border-width, 1px) solid var(--ds-border-inverse, #ffffff);
    transition: border-bottom 100ms linear;

    body:has(nav.nav-header) & {
        top: 50px;
    }

    &.scrolled {
        border-bottom: var(--ds-border-width, 1px) solid var(--ds-border, #0b120e24);
    }

    &.header-static {
        position: static;

        .sticky-header-actions {
            margin-inline-start: auto;
        }
    }
}

.sticky-mini-title {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 100ms linear;

    .sticky-header.scrolled & {
        opacity: 1;
        pointer-events: auto;
    }
}

.sticky-mini-title-bar {
    display: flex;
    align-items: center;
    gap: 6px;
}

.sticky-mini-title-row {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.sticky-mini-title-name {
    font-weight: 650;
    min-width: 24px;
}

.sticky-mini-title-text.only {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 480px;
    padding: 4px 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--ds-text, #292a2e);
}

.sticky-mini-dropdown {
    position: absolute;
    top: 100%;
    inset-inline-start: 0;
    margin-top: 4px;
    width: 360px;
    padding: 8px 0;
    background-color: var(--ds-surface-overlay, #fff);
    border-radius: 4px;
    box-shadow: var(--ds-shadow-overlay, 0 8px 9pt #1e1f2126, 0 0 1px #1e1f214f);
    z-index: 10;
}

.sticky-mini-dropdown-section {
    display: flex;
    flex-direction: column;
}

.sticky-mini-dropdown-space {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 40px;
    padding-block: 8px;
    padding-inline: 16px;
    color: var(--ds-text, #292a2e);
}

.sticky-mini-dropdown-space-icon {
    width: 24px;
    height: 24px;

    .space-avatar {
        width: 24px;
        height: 24px;
        border-radius: 6px;
        object-fit: cover;
    }
}

.sticky-mini-dropdown-space-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--ds-text, #292a2e);
}

.sticky-mini-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    color: var(--ds-text, #292a2e) !important;
    text-decoration: none;
    font-size: 14px;

    &:hover {
        background-color: var(--ds-background-neutral-subtle-hovered, #091e4214);
        text-decoration: none;
    }
}

.sticky-mini-dropdown-arrow {
    display: inline-flex;
    margin-left: 4px;
    color: var(--ds-icon-subtle, #44546f);
}

.sticky-mini-dropdown-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sticky-mini-title-page-icon,
.sticky-mini-dropdown-page-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.sticky-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding-right: 6px;
    line-height: 20px;
    color: var(--ds-text, #172b4d);
}

.update-info {
    display: inline-flex;
    align-items: center;
    color: var(--ds-text-subtlest, #6b6e76) !important;
    white-space: nowrap;
    text-decoration: none;
    cursor: default;
}

a.update-info-link {
    cursor: pointer;

    &:hover {
        color: var(--ds-text-subtlest, #6b6e76);
        text-decoration: underline;
    }
}

.header-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    height: 32px;
    padding: 0 10px;
    border: none;
    border-radius: 3px;
    background: transparent;
    color: var(--ds-text-subtle, #505258) !important;
    font: inherit;
    font-weight: 500;
    line-height: 32px;
    text-decoration: none;
    cursor: pointer;

    &:hover {
        background-color: var(--ds-background-neutral-subtle-hovered, #0515240f);
        color: var(--ds-text-subtle, #505258);
        text-decoration: none;
    }

    &:active {
        background-color: var(--ds-background-neutral-subtle-pressed, #0b120e24);
        color: var(--ds-text-subtle, #505258);
    }
}

.header-action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.copy-link-button,
.more-actions-trigger,
.sticky-mini-title-trigger,
.sticky-header-back {
    width: 32px;
    padding: 0;
}

.copy-link-button.copied {
    color: var(--ds-text-success, #216e4e);
}

.more-actions-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.more-actions-trigger[aria-expanded='true'] {
    background-color: var(--ds-background-selected, #e9f2fe);
    color: var(--ds-text-selected, #1868db);
    box-shadow: inset 0 0 0 1px var(--ds-border-selected, #1868db);

    svg {
        color: var(--ds-text-selected, #1868db);
    }

    &:hover {
        background-color: var(--ds-background-selected-hovered, #cfe1fd);
        color: var(--ds-text-selected, #1868db);
    }

    &:active {
        background-color: var(--ds-background-selected-pressed, #8fb8f6);
        color: var(--ds-text-selected, #1868db);
    }
}

.more-actions-menu {
    position: absolute;
    top: 100%;
    inset-inline-end: 0;
    margin-top: 4px;
    width: 260px;
    padding: 4px 0;
    background-color: var(--ds-surface-overlay, #fff);
    border-radius: 4px;
    box-shadow: var(--ds-shadow-overlay, 0 8px 9pt #1e1f2126, 0 0 1px #1e1f214f);
    color: var(--ds-text, #292a2e);
    z-index: 10;
}

.more-actions-item,
.more-actions-subitem {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 260px;
    min-height: 40px;
    padding-block: 8px;
    padding-inline: 16px;
    border: none;
    background: transparent;
    color: var(--ds-text, #292a2e);
    font: inherit;
    font-size: 14px;
    text-align: start;
    text-decoration: none;
    cursor: pointer;

    &:hover {
        background-color: var(--ds-background-neutral-subtle-hovered, #0515240f);
        text-decoration: none;
    }

    &:active {
        background-color: var(--ds-background-neutral-subtle-hovered, #0515240f);
    }
}

.more-actions-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--ds-icon-subtle, #44546f);
}

.more-actions-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--ds-text, #292a2e);
}

.more-actions-chevron {
    display: inline-flex;
    align-items: center;
    color: var(--ds-icon-subtle, #505258);
}

.more-actions-subscribe {
    position: relative;

    .more-actions-icon-filled {
        display: none;
    }

    &.subscribed {
        .more-actions-icon-empty {
            display: none;
        }

        .more-actions-icon-filled {
            display: inline-flex;
        }

        .subscribe-toggle {
            background-color: var(--ds-background-selected, #e9f2fe);
            color: var(--ds-text-selected, #1868db);

            &:hover {
                background-color: var(--ds-background-selected-hovered, #cfe1fd);
            }

            &:active {
                background-color: var(--ds-background-selected-pressed, #8fb8f6);
            }
        }
    }
}

.more-actions-subscribe-trigger {
    position: relative;

    &[aria-expanded='true'] {
        background-color: var(--ds-background-selected, #e9f2fe);
        color: var(--ds-text-selected, #1868db);

        &::before {
            content: '';
            position: absolute;
            inset-block: 0;
            inset-inline-start: 0;
            width: 2px;
            background-color: var(--ds-border-selected, #1868db);
        }

        .more-actions-chevron,
        .more-actions-label,
        .more-actions-icon {
            color: var(--ds-text-selected, #1868db);
        }

        &:hover {
            background-color: var(--ds-background-selected-hovered, #cfe1fd);
        }

        &:active {
            background-color: var(--ds-background-selected-pressed, #8fb8f6);
        }
    }
}

.more-actions-submenu {
    position: absolute;
    top: 0;
    inset-inline-end: 100%;
    margin-inline-end: 4px;
    min-width: 220px;
    padding: 4px 0;
    background-color: var(--ds-surface-overlay, #ffffff);
    border-radius: 4px;
    box-shadow: var(--ds-shadow-overlay, 0 0 0 1px #091e4214, 0 8px 12px #091e4226);
    display: flex;
    flex-direction: column;
    z-index: 11;

    &[hidden] {
        display: none;
    }
}
