.theme-toggle {
    display: inline-grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 2px;
    min-width: 68px;
    width: 68px;
    height: 34px;
    padding: 3px;
    border: 1px solid var(--theme-toggle-border, rgba(190, 219, 255, 0.18));
    border-radius: 999px;
    background: var(--theme-toggle-bg, rgba(8, 18, 43, 0.52));
    color: var(--theme-toggle-muted, rgba(232, 241, 255, 0.64));
    font: inherit;
    font-size: 0;
    cursor: pointer;
    white-space: nowrap;
}

.theme-toggle span {
    display: inline-grid;
    place-items: center;
    min-width: 0;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    line-height: 1;
    color: var(--theme-toggle-muted, rgba(232, 241, 255, 0.64));
}

.theme-toggle span::before {
    content: "";
    display: block;
    color: inherit;
}

.theme-toggle [data-theme-choice="dark"]::before {
    width: 16px;
    height: 16px;
    border-radius: 999px;
    background: transparent;
    box-shadow: inset -5px -3px 0 0 currentColor;
    transform: rotate(-12deg);
}

.theme-toggle [data-theme-choice="light"]::before {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: currentColor;
    box-shadow:
        0 -8px 0 -4px currentColor,
        0 8px 0 -4px currentColor,
        8px 0 0 -4px currentColor,
        -8px 0 0 -4px currentColor,
        6px 6px 0 -4px currentColor,
        -6px 6px 0 -4px currentColor,
        6px -6px 0 -4px currentColor,
        -6px -6px 0 -4px currentColor;
}

.theme-toggle [data-theme-choice].active {
    color: var(--theme-toggle-active-text, #06101d);
    background: var(--theme-toggle-active-bg, linear-gradient(135deg, #e0f7ff, #8bd6ff 48%, #a78bfa));
    box-shadow: 0 8px 22px var(--theme-toggle-shadow, rgba(85, 166, 255, 0.18));
}

.theme-toggle:focus-visible {
    outline: 2px solid var(--theme-toggle-focus, rgba(130, 234, 255, 0.7));
    outline-offset: 3px;
}

@media (max-width: 520px) {
    .theme-toggle {
        min-width: 62px;
        width: 62px;
        height: 32px;
    }
    .theme-toggle span {
        width: 26px;
        height: 26px;
    }
}
