/* Wizard responsive source of truth.
   Base visuals still live in style.css.

   Breakpoints used here:
   - compact: <= 1024px
   - mobile: <= 767px
   - narrow: <= 480px
   - plans stack: <= 820px
   - calendar compact: <= 720px
   - compact height: <= 760px
*/

@media (max-width: 1024px) {
    .wizard-overlay {
        min-height: var(--wizard-viewport-height, 100dvh);
        height: var(--wizard-viewport-height, 100dvh);
        align-items: stretch;
        justify-content: stretch;
        overflow: hidden;
        inset: 0;
    }

    .wizard-container {
        --wizard-footer-space: 104px;
        min-height: var(--wizard-viewport-height, 100dvh);
        height: var(--wizard-viewport-height, 100dvh);
        width: 100%;
        flex: 1;
        overflow: hidden;
        background:
            radial-gradient(circle at top left, rgba(172, 150, 106, 0.16), transparent 28%),
            linear-gradient(180deg, #fbf7f0 0%, #f2e8d9 100%);
    }

    .wizard-body {
        min-height: 0;
        overflow: hidden;
    }

    .wizard-main {
        min-height: 0;
        overflow-y: auto;
        overflow-x: visible;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
        padding: 18px 20px calc(var(--wizard-footer-space) + 18px);
    }

    .wizard-map-shell {
        padding-left: 16px;
        padding-right: 16px;
    }

    .wizard-top-bar {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px 0;
        align-items: flex-start;
        position: sticky;
        top: 0;
        z-index: 24;
        padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
        padding-right: 72px !important;
        background: rgba(252, 250, 246, 0.97);
        border-bottom: 1px solid rgba(95, 77, 48, 0.06);
        box-shadow: 0 2px 12px rgba(68, 50, 26, 0.04);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }

    .wizard-header {
        grid-column: 1;
        grid-row: 1;
        min-width: 0;
        padding-right: 0;
    }

    .wizard-header > div {
        max-width: none;
        gap: 4px;
        padding-right: 0;
    }

    .wizard-heading-row {
        display: block;
    }

    .wizard-heading-copy {
        gap: 2px;
    }

    .wizard-kicker {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        margin-bottom: 2px;
        padding: 0;
        border: none;
        border-radius: 0;
        background: transparent;
        color: #7a6b52;
        font-size: 0.65rem;
        font-weight: 500;
        letter-spacing: 0.06em;
        text-transform: uppercase;
    }

    .wizard-kicker-dot {
        width: 5px;
        height: 5px;
        border-radius: 999px;
        background: #ac966a;
        box-shadow: none;
    }

    .wizard-mobile-progress {
        margin-bottom: 4px;
        margin-left: 0;
    }

    .wizard-title {
        max-width: none;
        margin: 0;
        font-size: clamp(1.1rem, 6vw, 1.35rem);
        font-weight: 600;
        line-height: 1.2;
        letter-spacing: -0.02em;
    }

    .wizard-subtitle {
        max-width: 28ch;
        margin-top: 2px;
        color: #7a6f5e;
        font-size: 0.78rem;
        line-height: 1.35;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        overflow: hidden;
    }

    .wizard-close-btn {
        position: absolute;
        top: calc(8px + env(safe-area-inset-top));
        right: 10px;
        transform: none;
        width: 34px;
        height: 34px;
        min-width: 34px;
        min-height: 34px;
        padding: 0;
        border-radius: 8px;
    }

    .wizard-close-btn svg {
        width: 16px;
        height: 16px;
    }

    .wizard-footer-actions {
        left: 50%;
        bottom: max(12px, env(safe-area-inset-bottom));
        width: calc(100% - 24px);
    }

    .btn-label-desktop {
        display: none !important;
    }

    .wizard-footer-actions .btn .btn-label-mobile,
    .btn-label-mobile {
        display: block !important;
    }

    #wizard-footer.wizard-footer-actions--route.active {
        grid-template-columns: minmax(68px, 1fr) 52px 52px minmax(86px, 1fr);
        gap: 6px;
        padding: 8px;
        max-width: 460px;
    }

    #wizard-footer.wizard-footer-actions--route .route-sheet-toggle,
    #wizard-footer.wizard-footer-actions--route .wizard-support-footer-toggle {
        width: 52px;
        max-width: 52px;
        min-width: 52px;
        height: 56px;
        min-height: 56px;
        border-radius: 18px;
    }

    /* Compact route summary sheet: bottom sheet on tablets and phones. */
    .mobile-route-sheet {
        position: fixed;
        top: auto;
        right: 0;
        bottom: 0;
        left: 0;
        width: 100%;
        max-width: none;
        max-height: 70vh;
        padding-right: 14px;
        padding-bottom: env(safe-area-inset-bottom, 20px);
        padding-left: 14px;
        border-radius: 32px 32px 0 0;
        box-shadow: 0 -8px 32px rgba(47, 36, 21, 0.12);
        transform: translateY(100%);
        opacity: 0;
        z-index: 10011;
    }

    .mobile-route-sheet.active {
        transform: translateY(0);
        opacity: 1;
    }

    .mobile-route-sheet-backdrop {
        position: fixed;
        background: rgba(37, 27, 14, 0.24);
    }

    .mobile-route-sheet-handle {
        display: block;
        width: 44px;
        height: 5px;
        margin: 16px auto 20px;
        border-radius: 999px;
        background: rgba(47, 36, 21, 0.15);
        cursor: grab;
        transition: background 0.2s ease, transform 0.2s ease;
        touch-action: pan-y;
    }

    .mobile-route-sheet-handle:hover {
        background: rgba(47, 36, 21, 0.35);
    }

    .mobile-route-sheet-handle:active {
        cursor: grabbing;
        transform: scaleY(1.2);
    }

    .mobile-route-sheet.dragging {
        transition: none;
    }

    .mobile-route-sheet.dragging .mobile-route-sheet-handle {
        background: rgba(47, 36, 21, 0.4);
    }

    /* Step 2: route stays single-column in compact layouts. */
    .wizard-container[data-step="2"] .wizard-main {
        display: flex;
        flex-direction: column;
    }

    .wizard-container[data-step="2"] .step-content.active,
    .wizard-container[data-step="2"] #step-2 {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

    .wizard-container[data-step="2"] .route-step-hero .route-step-hero-copy h3,
    .wizard-container[data-step="2"] .route-step-stop-label,
    .wizard-container[data-step="2"] .access-card.route-stage-card .route-stage-card-copy h4 {
        display: none;
    }

    .wizard-container[data-step="2"] .access-grid-container {
        gap: 18px;
    }

    .wizard-container[data-step="2"] .route-step-shell {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .wizard-container[data-step="2"] .route-step-summary {
        display: none;
    }

    .wizard-container[data-step="2"] .access-card {
        padding: 20px 18px;
        border-radius: 26px;
        background: rgba(255, 255, 255, 0.94);
        box-shadow: 0 16px 32px rgba(68, 50, 26, 0.08);
    }

    .wizard-container[data-step="2"] .route-stage-card {
        padding: 22px 18px;
    }

    .wizard-container[data-step="2"] .route-stage-card-head {
        gap: 14px;
    }

    .wizard-container[data-step="2"] .access-form-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .wizard-container[data-step="2"] .route-access-field--parking {
        grid-column: auto;
    }

    .wizard-container[data-step="2"] .access-card h4 {
        margin-bottom: 16px;
        font-size: 1.2rem;
    }

    .wizard-container[data-step="2"] .toggle-group {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .wizard-container[data-step="2"] .toggle-btn {
        min-height: 52px;
    }

    /* Step 3: inventory switches to horizontal room chips and sticky controls. */
    .wizard-container[data-step="3"] .wizard-top-bar {
        gap: 6px;
        padding-bottom: 8px !important;
    }

    .wizard-container[data-step="3"] .wizard-title,
    .wizard-container[data-step="3"] .wizard-subtitle {
        margin-bottom: 0;
    }

    .wizard-container[data-step="3"] .wizard-subtitle {
        line-height: 1.32;
    }

    .wizard-container[data-step="3"] .wizard-body {
        margin-top: 0 !important;
    }

    .wizard-container[data-step="3"] #step-3 {
        gap: 0;
        height: 100%;
        margin-top: 0;
        padding-top: 0;
    }

    .wizard-container[data-step="3"] .wizard-main {
        padding-top: 10px !important;
        padding-bottom: calc(var(--wizard-footer-space) + 5px) !important;
    }

    .wizard-container[data-step="3"] #step-3-main {
        display: flex;
        flex: 1 1 auto;
        flex-direction: column;
        gap: 8px;
        min-height: 0;
        height: 100%;
        margin-top: 0;
        padding-top: 10px;
        padding-bottom: 5px;
        overflow: hidden;
        transform: none;
    }

    .wizard-container[data-step="3"] #step-3-main::after,
    .wizard-container[data-step="3"] #step-3-main > .inv-controls-container::before {
        content: none;
    }

    .inventory-controls-host {
        padding-top: 14px;
    }

    #step-3-main > .tabs-header {
        display: none;
        margin: 0;
        padding: 0;
        border: 0;
        min-height: 0;
        height: 0;
        overflow: hidden;
    }

    .inv-controls-container {
        position: sticky;
        top: calc(72px + env(safe-area-inset-top));
        z-index: 30;
        margin: -10px 0 10px;
        padding: 0 0 14px;
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .wizard-container[data-step="3"] #step-3-main > .inv-controls-container {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    .inv-controls-row {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .inv-search-bar,
    .room-grid-indicator {
        display: none;
    }

    .room-grid {
        display: flex;
        align-items: center;
        gap: 8px;
        min-height: auto;
        height: auto;
        padding: 4px 2px 2px;
        overflow-x: auto;
        overflow-y: hidden;
        border: none;
        background: transparent;
        box-shadow: none;
        scrollbar-width: none;
        scroll-snap-type: x proximity;
        -webkit-mask-image: linear-gradient(90deg, transparent 0, black 18px, black calc(100% - 18px), transparent 100%);
        mask-image: linear-gradient(90deg, transparent 0, black 18px, black calc(100% - 18px), transparent 100%);
    }

    .room-grid::-webkit-scrollbar {
        display: none;
    }

    .room-sq-btn {
        flex: 0 0 auto;
        min-width: max-content;
        min-height: 46px;
        padding: 0 14px;
        border-radius: 16px;
        border: 1px solid rgba(95, 77, 48, 0.12);
        background: rgba(255, 255, 255, 0.82);
        color: #6e604b;
        gap: 8px;
        opacity: 1;
        box-shadow: none;
        scroll-snap-align: start;
    }

    .room-sq-btn.active {
        background: #2f2415;
        border-color: #2f2415;
        color: #f8f3ea;
        box-shadow: none;
    }

    .room-sq-btn::after {
        display: none;
    }

    .room-sq-name {
        width: auto;
        max-width: none;
        font-size: 0.68rem;
        letter-spacing: 0.08em;
    }

    .inv-search-inner {
        position: relative;
        display: flex;
        width: 100%;
        min-height: 54px;
        padding: 0;
        border-radius: 18px;
        border: 1px solid rgba(95, 77, 48, 0.12);
        background: rgba(255, 255, 255, 0.92);
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        right: auto;
    }

    .search-toggle-btn,
    .search-toggle-btn:hover {
        box-shadow: none;
    }

    .inv-search-inner input {
        font-size: 0.96rem;
    }

    .inv-search-inner .search-clear {
        right: 12px;
        width: 28px;
        height: 28px;
        border-radius: 999px;
        background: rgba(172, 150, 106, 0.12);
        color: #6a5737;
    }

    .current-room-label {
        display: grid;
        grid-template-columns: auto 1fr auto;
        align-items: center;
        gap: 10px;
        padding: 0 2px;
        margin-top: 8px;
    }

    .tab-content {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .tab-content .no-results {
        grid-column: 1 / -1;
    }

    .inv-item {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        min-height: 84px;
        padding: 14px 16px;
        gap: 12px;
        border-radius: 20px;
        border: 1px solid rgba(95, 77, 48, 0.12);
        background: rgba(255, 255, 255, 0.9);
        box-shadow: none;
        height: 100%;
    }

    .inv-item:active {
        background: rgba(47, 36, 21, 0.03);
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }

    .inv-item.has-items {
        border-color: rgba(106, 87, 55, 0.34);
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(245, 235, 216, 0.96));
        box-shadow: none;
    }

    .inv-info {
        flex: 1 1 auto;
        min-width: 0;
        gap: 6px;
    }

    .inv-name {
        font-size: 0.98rem;
        line-height: 1.15;
    }

    .dim-display {
        margin-top: 0;
    }

    .inv-dim-tag {
        max-width: 120px;
    }

    .no-results {
        padding: 20px 16px;
        border-radius: 22px;
        background: rgba(255, 255, 255, 0.8);
        box-shadow: 0 14px 28px rgba(68, 50, 26, 0.05);
    }
}

@media (min-width: 768px) {
    .wizard-container[data-step="6"] {
        --wizard-footer-space: 96px !important;
    }

    .wizard-container[data-step="6"] .wizard-main {
        justify-content: center !important;
        padding-top: 0 !important;
        padding-bottom: var(--wizard-footer-space) !important;
    }

    .wizard-container[data-step="6"] #step-6.step-content.active {
        margin: auto !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }
}

@media (max-width: 767px) {
    .wizard-container {
        --wizard-content-top-gap: 12px;
        --wizard-content-bottom-gap: 16px;
    }

    .wizard-top-bar {
        display: block !important;
        min-height: 0;
        padding: calc(10px + env(safe-area-inset-top)) 16px 10px !important;
    }

    .wizard-header {
        display: block;
        width: 100%;
        min-width: 0;
        padding-right: 0 !important;
    }

    .wizard-header > div {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        align-content: flex-start !important;
        justify-items: start;
        gap: 6px;
        width: 100%;
        max-width: none;
        padding-right: 56px;
    }

    .wizard-heading-copy {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        align-content: start;
        justify-items: start;
        gap: 4px;
        width: 100%;
    }

    .wizard-mobile-progress {
        width: 100%;
        max-width: none;
        margin: 0 0 4px;
    }

    .wizard-kicker {
        display: none !important;
    }

    .wizard-title,
    .wizard-subtitle {
        width: 100%;
        max-width: none;
        text-align: left !important;
    }

    .wizard-title {
        margin: 0 !important;
        font-size: clamp(1.05rem, 6vw, 1.28rem) !important;
        line-height: 1.08 !important;
    }

    .wizard-subtitle {
        margin: 0 !important;
        font-size: 0.8rem !important;
        line-height: 1.3 !important;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }

    .wizard-close-btn {
        top: calc(10px + env(safe-area-inset-top)) !important;
        right: 16px !important;
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
        border-radius: 10px;
    }

    .wizard-main {
        overflow-y: auto !important;
        overflow-x: visible !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    .wizard-main .step-content.active {
        width: 100%;
        max-width: none !important;
        margin: 0 !important;
        flex: 0 0 auto !important;
        gap: 0 !important;
        box-sizing: border-box;
        padding-top: var(--wizard-content-top-gap) !important;
        padding-bottom: calc(var(--wizard-footer-space) + var(--wizard-content-bottom-gap, 16px) + env(safe-area-inset-bottom, 0px)) !important;
    }

    .step-content,
    .step-content.active,
    #step-2,
    #step-3,
    #step-3-main,
    #step-3-stairs,
    #step-4,
    #step-5,
    #step-6,
    #step-7 {
        min-height: auto !important;
        height: auto !important;
        overflow: visible !important;
    }

    .wizard-container[data-step="2"] .wizard-main,
    .wizard-container[data-step="3"] .wizard-main,
    .wizard-container[data-step="4"] .wizard-main,
    .wizard-container[data-step="5"] .wizard-main,
    .wizard-container[data-step="6"] .wizard-main,
    .wizard-container.budget-mode .wizard-main {
        overflow-y: auto !important;
        overflow-x: visible !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    .wizard-container[data-step="3"] #step-3-main {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    .wizard-container[data-step="3"] .inventory-list-viewport .tab-content {
        grid-template-columns: 1fr;
    }

    .wizard-container[data-step="6"] .wizard-main {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-top: var(--wizard-content-top-gap) !important;
    }

    .wizard-container[data-step="6"] #step-6.step-content.active {
        flex: 0 0 auto !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        overflow-y: auto;
        overflow-x: hidden;
        padding-top: 0 !important;
        padding-bottom: calc(var(--wizard-footer-space) + 28px + env(safe-area-inset-bottom, 0px)) !important;
    }

    .wizard-container[data-step="6"] .step-content--datos {
        justify-content: flex-start;
        gap: 14px;
        padding: 0 0 22px !important;
    }

    .wizard-container[data-step="6"] .datos-step-wrapper {
        max-width: none;
        padding-bottom: 18px;
    }

    .wizard-container.budget-mode {
        --wizard-footer-space: 92px;
    }

    .wizard-container.budget-mode .wizard-top-bar {
        padding: calc(10px + env(safe-area-inset-top)) 16px 6px !important;
        border-bottom: none !important;
        box-shadow: none !important;
    }

    .wizard-container.budget-mode .wizard-header,
    .wizard-container.budget-mode .wizard-mobile-progress,
    .wizard-container.budget-mode .wizard-kicker,
    .wizard-container.budget-mode .wizard-heading-row {
        display: none !important;
    }

    .wizard-container.budget-mode #step-7.step-content.active {
        align-items: stretch !important;
        padding: 16px 10px calc(var(--wizard-footer-space) + var(--wizard-content-bottom-gap, 16px) + env(safe-area-inset-bottom, 0px)) !important;
    }

    .wizard-container.budget-mode .budget-layout {
        width: 100% !important;
        max-width: none !important;
        gap: 12px;
        padding: 2px 2px 18px;
        overflow: visible;
    }

    .wizard-container.budget-mode .budget-bottom,
    .wizard-container.budget-mode .budget-left-column,
    .wizard-container.budget-mode .budget-right-column {
        width: 100%;
        gap: 12px !important;
    }

    .wizard-container.budget-mode .budget-hero {
        padding: 20px 18px 14px;
    }

    .wizard-container.budget-mode .budget-card {
        padding: 18px 16px;
        border-radius: 22px;
    }

    .wizard-container.budget-mode .budget-card--details {
        padding: 16px 16px 14px;
    }

    .wizard-container.budget-mode .budget-card--details .budget-summary-list {
        gap: 6px;
    }

    .wizard-container.budget-mode .budget-card--details .budget-summary-row {
        padding: 9px 10px;
        gap: 10px;
    }

    .wizard-container.budget-mode .budget-card--details .budget-summary-row--stacked {
        gap: 8px;
    }

    .wizard-container.budget-mode .budget-card--details .budget-summary-row--inventory {
        display: none;
    }

    .wizard-container.budget-mode .budget-card--inventory,
    .wizard-container.budget-mode .budget-inv-list {
        max-height: none;
        overflow: visible;
        padding-right: 0;
    }

    .wizard-container[data-step="4"] .plan-cards-container {
        margin: 22px 0 32px;
    }
}

@media (max-width: 1024px) and (min-width: 768px) and (orientation: portrait) {
    .wizard-container.budget-mode {
        --wizard-content-bottom-gap: 24px;
    }

    .wizard-container.budget-mode #step-7.step-content.active {
        padding: 18px 24px calc(var(--wizard-footer-space) + var(--wizard-content-bottom-gap) + env(safe-area-inset-bottom, 0px)) !important;
    }

    .wizard-container.budget-mode .budget-layout {
        padding-bottom: 28px;
    }

    .wizard-container.budget-mode .budget-layout::after {
        content: '';
        display: block;
        flex: 0 0 calc(var(--wizard-footer-space) + 8px);
        min-height: calc(var(--wizard-footer-space) + 8px);
    }
}

@media (max-width: 480px) {
    .wizard-container {
        --wizard-footer-space: 96px;
        min-height: var(--wizard-viewport-height, 100dvh);
        height: var(--wizard-viewport-height, 100dvh);
    }

    .wizard-footer-actions {
        grid-template-columns: minmax(78px, 1fr) minmax(92px, 1fr);
        gap: 8px;
        padding: 10px;
    }

    .inv-controls-container {
        top: calc(64px + env(safe-area-inset-top));
    }

    .wizard-container[data-step="3"] #step-3-main {
        padding-top: 12px;
        padding-bottom: 5px;
        transform: none;
    }

    .inventory-list-viewport {
        height: 100%;
        padding-bottom: 5px;
    }

    .inventory-controls-host {
        padding-top: 16px;
    }

    .current-room-label {
        grid-template-columns: 1fr auto;
    }

    .current-room-chip {
        grid-column: 1 / -1;
        justify-self: start;
    }

    .current-room-total {
        margin-left: 0;
    }

    .wizard-container[data-step="4"] .plan-card {
        padding: 20px 18px 18px;
        border-radius: 18px;
    }
}

@media (max-width: 1080px) {
    .wizard-container[data-step="4"] #step-4.step-content.active {
        padding: 28px 24px calc(var(--wizard-footer-space) + 20px);
    }

    .wizard-container[data-step="4"] .plan-cards-container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 22px;
        margin: 22px 0 40px;
    }

    .wizard-container[data-step="4"] .plan-card {
        padding: 24px 22px 22px;
        border-radius: 22px;
    }

    .wizard-container[data-step="4"] .plan-card--hero {
        padding-top: 24px;
    }

    .wizard-container[data-step="4"] .plan-title {
        font-size: clamp(1.28rem, 2vw, 1.6rem);
    }

    .wizard-container[data-step="4"] .plan-description,
    .wizard-container[data-step="4"] .plan-fit,
    .wizard-container[data-step="4"] .plan-features li {
        font-size: 0.9rem;
    }
}

@media (max-width: 820px) {
    .wizard-container[data-step="4"] #step-4.step-content.active {
        padding: 28px 20px calc(var(--wizard-footer-space) + 28px);
    }

    .wizard-container[data-step="4"] .plan-cards-container {
        display: flex !important;
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        gap: 16px;
        width: 100%;
        margin: 22px 0 32px;
        padding: 0;
        overflow-x: visible;
        overflow-y: visible;
        scroll-snap-type: none;
        scroll-padding-inline: 0;
        -webkit-overflow-scrolling: auto;
        touch-action: auto;
    }

    .wizard-container[data-step="4"] .plan-card {
        flex: 0 0 auto;
        width: 100%;
        min-width: 0;
        max-width: none;
        min-height: unset;
        padding: 22px 20px 20px;
        border-radius: 20px;
        overflow: visible;
        scroll-snap-align: none;
    }

    .wizard-container[data-step="4"] .plan-card--hero {
        padding-top: 22px;
    }

    .wizard-container[data-step="4"] .plan-card--hero .plan-badge {
        top: 0;
        transform: translate(-50%, -50%);
        font-size: 0.64rem;
    }
}

@media (min-width: 768px) and (max-width: 820px) {
    .wizard-container[data-step="4"] .wizard-main {
        padding-bottom: 280px;
    }

    .wizard-container[data-step="4"] .plan-cards-container::after {
        content: "";
        display: block;
        height: 120px;
        flex-shrink: 0;
    }
}

@media (min-width: 1081px) and (max-height: 760px) {
    .wizard-container[data-step="4"] #step-4.step-content.active {
        padding: 22px 32px 18px;
    }

    .wizard-container[data-step="4"] .plan-cards-container {
        gap: 22px;
        margin: 12px 0 32px;
    }

    .wizard-container[data-step="4"] .plan-card {
        padding: 22px 20px 18px;
        border-radius: 22px;
    }

    .wizard-container[data-step="4"] .plan-card--hero {
        padding-top: 24px;
    }

    .wizard-container[data-step="4"] .plan-head {
        gap: 12px;
        margin-bottom: 10px;
    }

    .wizard-container[data-step="4"] .plan-card-icon {
        width: 44px;
        height: 44px;
        border-radius: 12px;
    }

    .wizard-container[data-step="4"] .plan-title {
        font-size: clamp(1.28rem, 1.7vw, 1.55rem);
    }

    .wizard-container[data-step="4"] .plan-description {
        margin-bottom: 12px;
        font-size: 0.9rem;
        line-height: 1.45;
    }

    .wizard-container[data-step="4"] .plan-features {
        margin-top: 2px;
        padding-top: 10px;
    }

    .wizard-container[data-step="4"] .plan-features li {
        padding: 6px 0;
        font-size: 0.88rem;
        line-height: 1.32;
    }

    .wizard-container[data-step="4"] .plan-fit {
        padding-top: 12px;
        font-size: 0.86rem;
        line-height: 1.4;
    }
}

@media (max-width: 720px) {
    .wizard-container[data-step="5"] .wizard-main {
        padding-top: 14px !important;
        padding-bottom: calc(var(--wizard-footer-space) + 10px + env(safe-area-inset-bottom, 0px)) !important;
    }

    .wizard-container[data-step="5"] #step-5,
    .wizard-container[data-step="5"] #step-5.step-content.active {
        margin-top: 0 !important;
        margin-bottom: auto !important;
        padding-top: 0 !important;
        padding-bottom: 8px !important;
    }

    .wizard-container[data-step="5"] .calendar-wrapper {
        width: 100%;
        padding: 14px 10px 14px;
        border-radius: 20px;
    }

    .wizard-container[data-step="5"] .cal-header {
        margin-bottom: 12px;
        padding-bottom: 10px;
    }

    .wizard-container[data-step="5"] .cal-header h3 {
        font-size: 1.5rem;
    }

    .wizard-container[data-step="5"] .cal-nav {
        width: 40px;
        height: 40px;
        border-radius: 12px;
    }

    .wizard-container[data-step="5"] .cal-weekdays,
    .wizard-container[data-step="5"] .cal-grid {
        gap: 5px;
    }

    .wizard-container[data-step="5"] .cal-weekdays div {
        font-size: 0.6rem;
        letter-spacing: 0.06em;
    }

    .wizard-container[data-step="5"] .cal-day {
        min-height: 58px;
        padding: 7px 5px 8px;
        gap: 3px;
        border-radius: 13px;
    }

    .wizard-container[data-step="5"] .c-date {
        font-size: 0.84rem;
    }

    .wizard-container[data-step="5"] .c-price {
        font-size: clamp(0.67rem, 2.45vw, 0.76rem);
        line-height: 1.04;
    }

    .wizard-container[data-step="5"] .c-status {
        font-size: 0.58rem;
    }
}

@media (max-width: 720px) and (min-height: 780px) {
    .wizard-container[data-step="5"] .wizard-main {
        justify-content: center;
    }

    .wizard-container[data-step="5"] #step-5,
    .wizard-container[data-step="5"] #step-5.step-content.active {
        margin-top: auto !important;
        margin-bottom: auto !important;
        padding-top: 0 !important;
    }
}

@media (min-width: 721px) and (max-height: 760px) {
    .wizard-container[data-step="5"] .wizard-main {
        padding-top: 14px !important;
    }

    .wizard-container[data-step="5"] #step-5,
    .wizard-container[data-step="5"] #step-5.step-content.active {
        margin-top: 0 !important;
        margin-bottom: auto !important;
        padding-top: 0 !important;
    }

    .wizard-container[data-step="5"] .calendar-wrapper {
        padding: 16px 18px 18px;
        border-radius: 24px;
    }

    .wizard-container[data-step="5"] .cal-header {
        margin-bottom: 12px;
        padding-bottom: 10px;
    }

    .wizard-container[data-step="5"] .cal-header h3 {
        font-size: 1.48rem;
    }

    .wizard-container[data-step="5"] .cal-nav {
        width: 40px;
        height: 40px;
    }

    .wizard-container[data-step="5"] .cal-weekdays,
    .wizard-container[data-step="5"] .cal-grid {
        gap: 6px;
    }

    .wizard-container[data-step="5"] .cal-day {
        min-height: 50px;
        padding: 7px 8px;
        gap: 4px;
    }

    .wizard-container[data-step="5"] .c-date {
        font-size: 0.9rem;
    }

    .wizard-container[data-step="5"] .c-price {
        font-size: 0.8rem;
    }
}
