.header-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    white-space: nowrap;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 40px;
    padding: 0 12px 0 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--muted-strong);
    font: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition:
        background 0.18s ease,
        border-color 0.18s ease,
        color 0.18s ease,
        transform 0.18s ease;
}

.theme-toggle:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.14);
    color: var(--text);
}

.theme-toggle:focus-visible {
    outline: 2px solid var(--orange);
    outline-offset: 3px;
}

.theme-toggle-track {
    position: relative;
    width: 44px;
    height: 24px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.24);
}

.theme-toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--teal), var(--orange));
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.24);
    transition: transform 0.18s ease;
}

html[data-theme="light"] .theme-toggle {
    border-color: rgba(39, 30, 21, 0.15);
    background: rgba(255, 250, 241, 0.58);
    color: var(--muted-strong);
}

html[data-theme="light"] .theme-toggle:hover {
    border-color: rgba(31, 111, 107, 0.28);
    background: rgba(255, 250, 241, 0.86);
    color: var(--text);
}

html[data-theme="light"] .theme-toggle-track {
    background: rgba(39, 30, 21, 0.10);
    border-color: rgba(39, 30, 21, 0.14);
    box-shadow: inset 0 1px 3px rgba(39, 30, 21, 0.12);
}

html[data-theme="light"] .theme-toggle-thumb {
    transform: translateX(20px);
}

@media (max-width: 960px) {
    .header-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

@media (max-width: 720px) {
    .theme-toggle {
        min-height: 38px;
    }
}
