/* Shared, low-specificity UI for switching interface style and color mode. */
.he-preference-picker {
    position: relative;
    display: flex;
    align-items: center;
}

.he-preference-trigger {
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--he-fg, #344054);
    cursor: pointer;
}

.he-preference-trigger:hover,
.he-preference-trigger:focus,
.he-preference-picker.is-open .he-preference-trigger {
    border-color: var(--he-border-soft, #e1e6ed);
    background: var(--he-bg-light, #f2f4f7);
    color: var(--he-fg-strong, #101828);
    outline: 0;
}

.he-preference-trigger:focus-visible,
.he-preference-option:focus-visible {
    outline: 3px solid var(--he-focus-ring, #145cc5);
    outline-offset: 2px;
}

.he-preference-trigger i {
    font-size: 20px;
    line-height: 1;
}

.he-preference-panel {
    position: absolute;
    z-index: 1080;
    top: calc(100% + 8px);
    right: 0;
    width: 244px;
    padding: 8px;
    border: 1px solid var(--he-border-soft, #e1e6ed);
    border-radius: 10px;
    background: var(--he-card-bg, #fff);
    box-shadow: var(--he-shadow-overlay, 0 18px 44px rgba(16, 24, 40, 0.16));
    color: var(--he-fg, #344054);
}

.he-preference-panel[hidden] {
    display: none;
}

.he-preference-heading {
    padding: 6px 10px 4px;
    color: var(--he-fg-muted, #667085);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1.4;
    text-transform: uppercase;
}

.he-preference-option {
    position: relative;
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) 18px;
    gap: 8px;
    align-items: center;
    width: 100%;
    min-height: 40px;
    padding: 8px 10px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--he-fg, #344054);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.he-preference-option--interface {
    grid-template-columns: minmax(0, 1fr) 18px;
}

.he-preference-option:hover,
.he-preference-option:focus {
    background: var(--he-primary-muted, rgba(20, 92, 197, 0.09));
    color: var(--he-fg-strong, #101828);
    text-decoration: none;
    outline: 0;
}

.he-preference-option.is-selected {
    background: var(--he-primary-muted, rgba(20, 92, 197, 0.09));
    color: var(--he-primary-accessible, #0b4aa2);
}

.he-preference-option i {
    font-size: 17px;
    line-height: 1;
}

.he-preference-check {
    justify-self: end;
    color: var(--he-primary-accessible, #0b4aa2);
    font-weight: 800;
    opacity: 0;
}

.he-preference-option.is-selected .he-preference-check {
    opacity: 1;
}

.he-preference-divider {
    height: 1px;
    margin: 7px 4px;
    background: var(--he-border-soft, #e1e6ed);
}

@media (max-width: 575.98px) {
    .he-preference-panel {
        position: fixed;
        top: 56px;
        right: 10px;
        left: 10px;
        width: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .he-preference-trigger,
    .he-preference-option {
        transition-duration: 0.01ms;
    }
}
