@layer components {
    .theme-switch {
        display: grid;
        gap: var(--space-2xs);
    }

    /* The settings screen: a field like the others in its grid. */
    .theme-switch--setting {
        width: 100%;
        max-width: 32rem;
    }

    .theme-switch--setting .theme-switch__select {
        padding: var(--space-xs) var(--space-s);
        border: 1px solid var(--color-border);
        border-radius: var(--radius-m);
        background-color: var(--color-surface);
        color: var(--color-text);
        font-size: var(--text-m);
    }

    /* The footer: one line, as muted as the links beside it. */
    .theme-switch--compact {
        display: flex;
        align-items: center;
        gap: var(--space-xs);
    }

    .theme-switch--compact .theme-switch__select {
        min-block-size: 2rem;
        padding-inline: var(--space-xs);
        border: 1px solid var(--color-border);
        border-radius: var(--radius-m);
        background-color: transparent;
        color: inherit;
        font: inherit;
    }

    .theme-switch__label {
        font-size: var(--text-s);
    }

    .theme-switch__state:empty {
        display: none;
    }

    .theme-switch__state,
    .theme-switch__hint {
        margin: 0;
        color: var(--color-text-muted);
        font-size: var(--text-s);
    }
}
