:root {
    scroll-padding-top: 72px;
}

.wizard-shell {
    display: grid;
    grid-template-columns: minmax(18rem, 1fr) clamp(15rem, 25vw, 20rem);
    gap: 1rem;
    align-items: start;
    width: 100%;
}

@media (max-width: 1180px) {
    .wizard-shell {
        grid-template-columns: minmax(0, 1fr);
    }
}

.wizard-shell .wizard-main {
    min-width: 0;
}

.wizard-summary {
    display: none;
}

.wizard-sidebar {
    position: sticky;
    top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sidebar-card {
    border: 1px solid var(--border, #d0d7de);
    background: var(--surface, #fff);
    border-radius: 0.5rem;
    padding: 0.75rem 0.9rem;
    color: inherit;
}

.sidebar-card + .sidebar-card {
    margin-top: 0.75rem;
}

.sidebar-card h4 {
    margin: 0.1rem 0 0.5rem;
    font-size: 1rem;
    font-weight: 600;
}

.sidebar-card p {
    margin: 0.4rem 0 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

.sidebar-list {
    margin: 0;
    padding-left: 1rem;
    display: grid;
    gap: 0.35rem;
}

.sidebar-list li {
    font-size: 0.95rem;
}

.sidebar-list li strong {
    font-weight: 600;
}

.sidebar-hardware {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border, #d0d7de);
    display: grid;
    gap: 0.4rem;
}

.sidebar-hardware__title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
}

.sidebar-hardware__empty {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

.sidebar-hardware__core {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.4;
}

.sidebar-hardware__headers {
    margin: 0;
    padding-left: 1.1rem;
    display: grid;
    gap: 0.3rem;
    font-size: 0.9rem;
    line-height: 1.4;
}

.sidebar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.6rem;
}

.wizard-sidebar .btn {
    padding: 0.45rem 0.7rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border, #d0d7de);
    background: var(--bg-elev-1, #f6f8fa);
    cursor: pointer;
    font: inherit;
    color: inherit;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.wizard-sidebar .btn.primary {
    background: var(--accent, #2ea6ff);
    color: var(--accent-contrast, #001b2b);
    border: 0;
}

.wizard-sidebar .btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.wizard-sidebar .btn:focus-visible {
    outline: 2px solid var(--focus-ring, #66b3ff);
    outline-offset: 2px;
}

.recommended-bundle-callout {
    margin: 1rem 0 1.5rem;
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    background: var(--surface-subtle, #f1f5f9);
    border: 1px solid var(--border-subtle, #d6dee6);
}

.recommended-bundle-callout .btn {
    margin: 0 0 0.5rem;
}

.recommended-bundle-callout .btn.is-active {
    background: var(--accent-strong, #0059c9);
    color: var(--accent-contrast, #fff);
}

.recommended-bundle-callout__description {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.45;
    color: var(--text-muted, #475569);
}

.recommended-bundle-callout__description[data-active="true"] {
    color: var(--text-strong, #0f172a);
    font-weight: 500;
}

.sidebar-warning {
    margin: 0.5rem 0 0;
    font-size: 0.85rem;
    color: var(--warning-text);
}

.sidebar-fw-label {
    font-weight: 600;
    font-size: 0.95rem;
}

.sidebar-fw-note {
    margin: 0.35rem 0 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

.sidebar-muted {
    color: var(--text-muted, #57606a);
}

@media (max-width: 1180px) {
    .wizard-sidebar {
        position: static;
    }
}

@media (max-width: 720px) {
    .wizard-sidebar {
        display: none;
    }

    .wizard-summary {
        position: sticky;
        bottom: 0;
        left: 0;
        right: 0;
        display: grid;
        gap: 0.5rem;
        padding: 0.5rem;
        background: linear-gradient(180deg, rgba(248, 250, 252, 0) 0%, rgba(248, 250, 252, 0.95) 40%, rgba(248, 250, 252, 1) 100%);
        z-index: 30;
    }

    .wizard-summary__toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.35rem;
        width: 100%;
        padding: 0.75rem 1.1rem;
        border-radius: 999px;
        border: 1px solid var(--border-subtle, #d8dee6);
        background: var(--surface, #ffffff);
        color: inherit;
        font: inherit;
        font-weight: 600;
        letter-spacing: 0.01em;
        box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
        cursor: pointer;
        transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    }

    .wizard-summary__toggle:focus-visible {
        outline: 3px solid var(--focus-ring, rgba(37, 99, 235, 0.45));
        outline-offset: 3px;
    }

    .wizard-summary__toggle:hover {
        background: var(--surface-elev-1, #f8fafc);
        border-color: var(--border, #cbd5f0);
        box-shadow: 0 6px 18px rgba(15, 23, 42, 0.16);
    }

    .wizard-summary.is-open .wizard-summary__toggle {
        box-shadow: 0 6px 18px rgba(15, 23, 42, 0.18);
    }

    .wizard-summary__drawer {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        transform: translateY(calc(100% + 16px));
        transition: transform 0.35s ease;
        z-index: 60;
        pointer-events: none;
    }

    .wizard-summary.is-open .wizard-summary__drawer {
        transform: translateY(0);
        pointer-events: auto;
    }

    .wizard-summary__drawer-surface {
        background: var(--surface, #ffffff);
        border-radius: 1.25rem 1.25rem 0 0;
        box-shadow: 0 -8px 26px rgba(15, 23, 42, 0.24);
        padding: 1.25rem clamp(1rem, 4vw, 1.75rem) calc(1.75rem + env(safe-area-inset-bottom, 0px));
        max-height: min(80vh, 640px);
        overflow-y: auto;
        border: 1px solid var(--border-muted, rgba(148, 163, 184, 0.35));
        border-bottom: 0;
    }

    .wizard-summary__drawer-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 1rem;
        margin-bottom: 1rem;
    }

    .wizard-summary__drawer-title {
        margin: 0;
        font-size: 1.1rem;
        font-weight: 600;
        color: var(--text-strong, #0f172a);
    }

    .wizard-summary__close {
        border: 1px solid transparent;
        border-radius: 999px;
        padding: 0.4rem 0.9rem;
        font: inherit;
        font-size: 0.9rem;
        font-weight: 600;
        background: var(--surface-subtle, #e2e8f0);
        color: var(--text-strong, #0f172a);
        cursor: pointer;
        transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    }

    .wizard-summary__close:hover {
        background: var(--surface, #ffffff);
        border-color: var(--border-subtle, #cbd5f0);
    }

    .wizard-summary__close:focus-visible {
        outline: 3px solid var(--focus-ring, rgba(37, 99, 235, 0.45));
        outline-offset: 3px;
    }

    .wizard-summary__card {
        display: block;
    }

    body.is-mobile-summary-open {
        overflow: hidden;
        touch-action: none;
    }
}
