/* Sun / moon pill switch (toolbar + feed settings) */
.wh-theme-toggle--pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    flex-shrink: 0;
    line-height: 0;
    -webkit-tap-highlight-color: transparent;
}
.wh-theme-toggle--pill:focus {
    outline: none;
}
.wh-theme-toggle--pill:focus-visible .wh-theme-toggle__track {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(34, 90, 234, 0.45);
}
.wh-theme-toggle--pill:active .wh-theme-toggle__thumb {
    width: 24px;
}
.wh-theme-toggle--pill.is-dark:active .wh-theme-toggle__thumb {
    transform: translateX(24px);
}

.wh-theme-toggle__track {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    justify-items: center;
    width: 54px;
    height: 30px;
    padding: 3px;
    border-radius: 999px;
    background: linear-gradient(180deg, #f3f4f6 0%, #e5e7eb 100%);
    border: 1px solid #d1d5db;
    box-sizing: border-box;
    transition: background 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}
.wh-theme-toggle--pill:hover .wh-theme-toggle__track {
    border-color: #9ca3af;
}
.wh-theme-toggle--pill.is-dark .wh-theme-toggle__track {
    background: linear-gradient(180deg, #334155 0%, #1e293b 100%);
    border-color: #475569;
}
.wh-theme-toggle--pill.is-dark:hover .wh-theme-toggle__track {
    border-color: #64748b;
}

.wh-theme-toggle__glyph {
    width: 13px;
    height: 13px;
    z-index: 1;
    color: #94a3b8;
    transition: color 0.22s ease, opacity 0.22s ease;
    pointer-events: none;
}
.wh-theme-toggle--pill:not(.is-dark) .wh-theme-toggle__glyph--sun {
    color: #d97706;
}
.wh-theme-toggle--pill.is-dark .wh-theme-toggle__glyph--moon {
    color: #93c5fd;
}
.wh-theme-toggle--pill:not(.is-dark) .wh-theme-toggle__glyph--moon {
    opacity: 0.45;
}
.wh-theme-toggle--pill.is-dark .wh-theme-toggle__glyph--sun {
    opacity: 0.4;
}

.wh-theme-toggle__thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.14), 0 0 0 0.5px rgba(15, 23, 42, 0.06);
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), width 0.12s ease, background 0.22s ease;
    pointer-events: none;
}
.wh-theme-toggle--pill.is-dark .wh-theme-toggle__thumb {
    transform: translateX(26px);
    background: #cbd5e1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

/* Header toolbar — align with "See same ads?" chip */
.dashboard-header-actions .wh-theme-toggle--toolbar {
    align-self: center;
    margin: 0;
    min-height: 30px;
}

/* Feed settings menu row */
.fw-ad-visibility__row--theme {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 2px;
    cursor: default;
}
.fw-ad-visibility__row--theme .fw-ad-visibility__text {
    flex: 1;
    min-width: 0;
}
.fw-ad-visibility-menu .wh-theme-toggle--pill:focus-visible .wh-theme-toggle__track {
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.9), 0 0 0 4px rgba(59, 130, 246, 0.55);
}
