/* Transport only: the component geometry, typography and colors come from the service CSS. */
html[data-theme],
html[data-theme] body.wb-guide-feature-example {
    width: 100%;
    height: auto;
    min-height: 0;
    overflow: hidden;
    /* The Dashboard locks its own viewport; guide examples must chain scrolling to the article. */
    overscroll-behavior: auto;
    background: transparent !important;
}

body.wb-guide-feature-example {
    display: block;
    margin: 0;
    padding: 8px;
}

#preview-root {
    display: flow-root;
    width: 100%;
    min-width: 0;
}

/* The real sidebar control is displayed above a real service panel for the theme example. */
.guide-preview-theme-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    width: min(686px, 100%);
    margin: 0 auto 16px;
}

.guide-preview-theme-controls .wb-theme-row {
    width: min(260px, calc(100% - 54px));
}

#preview-root [data-guide-preview-part] {
    position: relative;
    transition: all .3s cubic-bezier(.4, 0, .2, 1);
}

/* Highlight the visible pill, including service toggle wrappers without their own radius. */
#preview-root :is(.cb-switch, .toggle-switch, .wb-switch)[data-guide-preview-part] {
    border-radius: 999px;
}

#preview-root .timeline-container[data-guide-preview-part] {
    border-radius: 14px;
}

/* Same element-sized plaque highlight as Daily Pulse and Focus Audit in guide.css. */
#preview-root [data-guide-preview-part].is-guide-highlighted {
    box-shadow: 0 0 0 2px #fff, 0 8px 24px rgba(0, 0, 0, .35) !important;
    transform: translateY(-2px) !important;
    overflow: visible !important;
    z-index: 5;
}

#preview-root [data-guide-preview-part].is-guide-highlighted::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: inherit;
    border: 2px solid #fff;
    box-shadow: 0 0 15px rgba(255, 255, 255, .65);
    pointer-events: none;
    animation: guidePlaqueGlow 2s infinite ease-in-out;
}

@keyframes guidePlaqueGlow {
    0%, 100% { opacity: .55; }
    50% { opacity: 1; }
}

/* Reserve halo space in the scrolling viewport without changing the service row widths. */
#preview-root #block-topics .sites-list {
    width: calc(100% + 12px);
    max-width: none;
    margin-left: -6px;
    padding: 6px;
}

#preview-root #settings-whitelist-panel .whitelist-rule-list {
    padding-top: 6px;
}

@media (max-width: 768px) {
    #preview-root .cb-category-list {
        flex: 0 0 calc(100% + 12px);
        width: calc(100% + 12px);
        padding: 6px;
    }

    #preview-root #settings-whitelist-panel .whitelist-rule-list {
        width: calc(100% + 12px);
        padding: 6px 6px 12px;
        margin-inline: -6px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .wb-guide-feature-example *,
    .wb-guide-feature-example *::before,
    .wb-guide-feature-example *::after {
        scroll-behavior: auto !important;
        animation: none !important;
        transition: none !important;
    }
}
