/* Custom Card Wizard — UI UX PRO MAX aligned with CardSwitch tokens */

:root {
    --wizard-bg: var(--bg-color);
    --wizard-card-bg: var(--glass-bg);
    --wizard-accent: var(--accent-color);
    --wizard-radius: 24px;
    --wizard-shadow: var(--shadow-soft);
    --wizard-transition: 200ms ease-out;
    --wizard-touch-min: 44px;
    --wizard-muted: #475569;
    --wizard-text: #0f172a;
}

.custom-card-wizard {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 120px);
    max-width: 480px;
    margin: 0 auto;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.ccw-intro-banner {
    background: rgba(207, 179, 120, 0.12);
    border: 1px solid rgba(207, 179, 120, 0.35);
    border-radius: 16px;
    padding: 12px 14px;
    font-size: 0.82rem;
    color: var(--wizard-muted);
    line-height: 1.5;
    margin-bottom: 16px;
}

.ccw-intro-banner i {
    color: var(--wizard-accent);
    margin-right: 6px;
}

.ccw-info-panel {
    background: rgba(14, 165, 233, 0.08);
    border: 1px solid rgba(14, 165, 233, 0.22);
    border-radius: 18px;
    padding: 16px 16px 14px;
    margin-top: 4px;
}

.ccw-info-panel-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(14, 165, 233, 0.14);
    color: #0284c7;
    font-size: 1.1rem;
    margin-bottom: 12px;
}

.ccw-info-panel-lead {
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--wizard-text);
    margin: 0 0 12px;
}

.ccw-info-panel-list {
    margin: 0;
    padding-left: 1.15rem;
    font-size: 0.84rem;
    line-height: 1.55;
    color: var(--wizard-muted);
}

.ccw-info-panel-list li + li {
    margin-top: 6px;
}

.ccw-share-highlight {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.22);
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 14px;
    font-size: 0.84rem;
    line-height: 1.5;
    color: var(--wizard-muted);
}

.ccw-share-highlight i {
    color: #6366f1;
    margin-top: 2px;
    flex-shrink: 0;
}

.ccw-store-panel {
    margin-top: 4px;
}

.ccw-store-name-input {
    margin-bottom: 4px;
}

.ccw-store-questions {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.ccw-store-q-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ccw-store-q-label {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--wizard-text);
    line-height: 1.4;
}

.ccw-store-q-hint {
    margin: 0 0 4px;
    font-size: 0.8rem;
    color: var(--wizard-muted);
    line-height: 1.45;
}

.ccw-store-bento .ccw-bento-card {
    min-height: 64px;
}

.ccw-store-inline-field {
    margin-top: 4px;
}

.ccw-cap-panel {
    margin-top: 4px;
}

.ccw-cap-hint {
    margin: 0 0 10px;
    font-size: 0.8rem;
    color: var(--wizard-muted);
    line-height: 1.45;
}

.ccw-cap-cycle-label {
    margin: 20px 0 10px;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--wizard-text);
}

.ccw-cap-pills {
    margin-top: 0;
}

.ccw-progress-wrap {
    margin-bottom: 12px;
}

.ccw-progress-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.78rem;
    color: var(--wizard-muted);
    font-weight: 600;
}

.ccw-progress-bar {
    height: 4px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 999px;
    overflow: hidden;
}

.ccw-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 999px;
    transition: width var(--wizard-transition);
}

.ccw-context-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(102, 126, 234, 0.12);
    color: #667eea;
    margin-bottom: 12px;
}

.ccw-step-body {
    flex: 1;
    animation: ccwStepIn 0.2s ease-out;
}

@keyframes ccwStepIn {
    from {
        opacity: 0;
        transform: translateX(12px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .ccw-step-body {
        animation: none;
    }
}

.ccw-question {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--wizard-text);
    margin: 0 0 8px;
    line-height: 1.35;
}

.ccw-hint {
    font-size: 0.85rem;
    color: var(--wizard-muted);
    margin: 0 0 20px;
    line-height: 1.5;
}

.ccw-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--wizard-muted);
    margin-bottom: 8px;
}

.ccw-input {
    width: 100%;
    min-height: var(--wizard-touch-min);
    padding: 12px 16px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 14px;
    font-size: 1rem;
    background: var(--card-bg);
    transition: border-color var(--wizard-transition), box-shadow var(--wizard-transition);
}

.ccw-input:focus {
    outline: none;
    border-color: var(--wizard-accent);
    box-shadow: 0 0 0 3px rgba(207, 179, 120, 0.25);
}

.ccw-textarea {
    min-height: 88px;
    resize: vertical;
}

/* Bento choice grid */
.ccw-bento-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

@media (min-width: 400px) {
    .ccw-bento-grid.ccw-bento-2 {
        grid-template-columns: 1fr 1fr;
    }
}

.ccw-bento-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-height: 72px;
    padding: 16px;
    border: 2px solid rgba(0, 0, 0, 0.08);
    border-radius: 20px;
    background: var(--card-bg);
    box-shadow: var(--wizard-shadow);
    cursor: pointer;
    text-align: left;
    transition: border-color var(--wizard-transition), background var(--wizard-transition), box-shadow var(--wizard-transition);
}

.ccw-bento-card:hover {
    box-shadow: var(--shadow-hover);
}

.ccw-bento-card:active {
    transform: scale(0.98);
}

.ccw-bento-card.selected {
    border-color: var(--wizard-accent);
    background: rgba(207, 179, 120, 0.12);
}

.ccw-bento-card.selected::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 12px;
    right: 12px;
    color: var(--wizard-accent);
    font-size: 0.9rem;
}

.ccw-bento-card:focus-visible {
    outline: 2px solid var(--wizard-accent);
    outline-offset: 2px;
}

.ccw-bento-icon {
    font-size: 1.25rem;
    color: #667eea;
    margin-bottom: 4px;
}

.ccw-bento-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--wizard-text);
}

.ccw-bento-sub {
    font-size: 0.78rem;
    color: var(--wizard-muted);
    line-height: 1.4;
}

.ccw-yesno-summary {
    background: rgba(102, 126, 234, 0.08);
    border: 1px solid rgba(102, 126, 234, 0.18);
    border-radius: 16px;
    padding: 12px 14px;
    margin-bottom: 16px;
}

.ccw-yesno-summary-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 8px;
}

.ccw-yesno-summary-list {
    margin: 0;
    padding-left: 0;
    list-style: none;
    font-size: 0.82rem;
    color: var(--wizard-text);
    line-height: 1.55;
}

.ccw-yesno-summary-list > li {
    font-weight: 600;
}

.ccw-yesno-summary-list > li + li {
    margin-top: 10px;
}

.ccw-yesno-summary-sublist {
    margin: 6px 0 0;
    padding: 0 0 0 14px;
    list-style: none;
    border-left: 2px solid rgba(102, 126, 234, 0.22);
    font-weight: 400;
}

.ccw-yesno-summary-sublist li {
    font-size: 0.8rem;
    color: var(--wizard-muted);
    line-height: 1.5;
}

.ccw-yesno-summary-sublist > li + li {
    margin-top: 4px;
}

.ccw-yesno-summary-sublist .ccw-yesno-summary-sublist {
    margin-top: 4px;
    padding-left: 12px;
    border-left-color: rgba(102, 126, 234, 0.14);
}

.ccw-yesno-summary-sublist .ccw-yesno-summary-sublist li {
    font-size: 0.78rem;
}

/* Pills */
.ccw-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ccw-pill {
    min-height: var(--wizard-touch-min);
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: var(--card-bg);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--wizard-transition);
}

.ccw-pill.selected {
    border-color: var(--wizard-accent);
    background: rgba(207, 179, 120, 0.15);
    color: var(--wizard-text);
}

/* Color swatches */
.ccw-color-panel {
    background: var(--card-bg);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 20px;
    padding: 16px;
    box-shadow: var(--wizard-shadow);
}

.ccw-color-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px 10px;
    justify-items: center;
}

@media (min-width: 400px) {
    .ccw-color-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 16px 12px;
    }
}

.ccw-color-swatch {
    position: relative;
    width: 48px;
    height: 48px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 50%;
    transition: transform var(--wizard-transition);
}

.ccw-color-swatch-inner {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.12);
    transition: box-shadow var(--wizard-transition), transform var(--wizard-transition);
}

.ccw-color-swatch-check {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.28);
    color: #fff;
    font-size: 0.85rem;
    opacity: 0;
    transform: scale(0.6);
    transition: opacity var(--wizard-transition), transform var(--wizard-transition);
    pointer-events: none;
}

.ccw-color-swatch:hover .ccw-color-swatch-inner {
    transform: scale(1.06);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1), 0 4px 14px rgba(0, 0, 0, 0.16);
}

.ccw-color-swatch:active {
    transform: scale(0.96);
}

.ccw-color-swatch.selected .ccw-color-swatch-inner {
    box-shadow: 0 0 0 3px var(--card-bg), 0 0 0 5px var(--wizard-accent), 0 4px 14px rgba(207, 179, 120, 0.35);
}

.ccw-color-swatch.selected .ccw-color-swatch-check {
    opacity: 1;
    transform: scale(1);
}

.ccw-color-swatch:focus-visible {
    outline: 2px solid var(--wizard-accent);
    outline-offset: 3px;
}

.ccw-color-custom-row {
    display: flex;
    justify-content: center;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px dashed rgba(0, 0, 0, 0.08);
}

.ccw-color-custom-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.ccw-color-custom-ring {
    position: relative;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(118, 75, 162, 0.15));
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06), 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: box-shadow var(--wizard-transition), transform var(--wizard-transition);
}

.ccw-color-custom-preview {
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
    transition: background var(--wizard-transition);
}

.ccw-color-custom-icon {
    position: relative;
    z-index: 1;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.92);
    color: #667eea;
    font-size: 0.72rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    pointer-events: none;
    transition: opacity var(--wizard-transition), transform var(--wizard-transition);
}

.ccw-color-custom-wrap input[type="color"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    border: none;
    padding: 0;
    border-radius: 50%;
}

.ccw-color-custom-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--wizard-muted);
    transition: color var(--wizard-transition);
}

.ccw-color-custom-wrap:hover .ccw-color-custom-ring {
    transform: scale(1.04);
    box-shadow: inset 0 0 0 1px rgba(102, 126, 234, 0.2), 0 4px 14px rgba(102, 126, 234, 0.18);
}

.ccw-color-custom-wrap.selected .ccw-color-custom-ring {
    box-shadow: 0 0 0 3px var(--card-bg), 0 0 0 5px var(--wizard-accent), 0 4px 14px rgba(207, 179, 120, 0.35);
}

.ccw-color-custom-wrap.selected .ccw-color-custom-icon {
    opacity: 0;
    transform: scale(0.5);
}

.ccw-color-custom-wrap.selected .ccw-color-custom-label {
    color: var(--wizard-text);
}

.ccw-color-custom-wrap:focus-within .ccw-color-custom-ring {
    outline: 2px solid var(--wizard-accent);
    outline-offset: 3px;
}

/* Number with unit */
.ccw-number-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.ccw-number-row .ccw-input {
    flex: 1;
}

.ccw-unit-pill {
    display: flex;
    align-items: center;
    padding: 0 16px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.05);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--wizard-muted);
    white-space: nowrap;
}

/* Ratio / numeric inputs */
.ccw-numeric-input {
    font-size: 1.15rem;
    font-weight: 600;
    text-align: center;
    letter-spacing: 0.02em;
}

.ccw-ratio-panel {
    background: var(--card-bg);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 20px;
    padding: 16px;
    box-shadow: var(--wizard-shadow);
}

.ccw-ratio-example {
    font-size: 0.82rem;
    color: var(--wizard-muted);
    background: rgba(102, 126, 234, 0.08);
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 16px;
    line-height: 1.5;
    text-align: center;
}

.ccw-ratio-example strong {
    color: #667eea;
    font-weight: 700;
}

.ccw-ratio-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ccw-ratio-field-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--wizard-muted);
    margin-bottom: 8px;
}

.ccw-ratio-input-wrap {
    display: flex;
    align-items: stretch;
    gap: 0;
    border-radius: 16px;
    overflow: hidden;
    border: 2px solid rgba(0, 0, 0, 0.08);
    transition: border-color var(--wizard-transition), box-shadow var(--wizard-transition);
}

.ccw-ratio-input-wrap:focus-within {
    border-color: var(--wizard-accent);
    box-shadow: 0 0 0 3px rgba(207, 179, 120, 0.2);
}

.ccw-ratio-input {
    flex: 1;
    min-height: 56px;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    font-size: 1.35rem !important;
    font-weight: 700;
}

.ccw-ratio-unit {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    padding: 0 14px;
    background: rgba(0, 0, 0, 0.04);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--wizard-muted);
}

.ccw-ratio-stack-eq {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px 0;
}

.ccw-ratio-stack-eq-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(102, 126, 234, 0.12);
    color: #667eea;
    font-size: 1.1rem;
    font-weight: 800;
}

/* Legacy compact ratio row (fallback) */
.ccw-ratio-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ccw-ratio-row .ccw-input {
    width: 80px;
    flex: 0 0 80px;
    text-align: center;
}

.ccw-ratio-eq {
    font-weight: 700;
    color: var(--wizard-muted);
    font-size: 1.1rem;
}

.ccw-ratio-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--wizard-muted);
}

/* Payment checkboxes */
.ccw-check-grid {
    display: grid;
    gap: 8px;
}

.ccw-check-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: var(--wizard-touch-min);
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    cursor: pointer;
}

.ccw-check-item input {
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

.ccw-payment-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ccw-payment-custom-label {
    margin: 0 0 8px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--wizard-text, #1a1a2e);
}

.ccw-payment-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 8px;
    margin-bottom: 10px;
}

.ccw-payment-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(102, 126, 234, 0.12);
    border: 1px solid rgba(102, 126, 234, 0.25);
    font-size: 0.875rem;
    color: var(--wizard-text, #1a1a2e);
}

.ccw-payment-tag-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    opacity: 0.7;
    cursor: pointer;
}

.ccw-payment-tag-remove:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.06);
}

.ccw-payment-add-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.ccw-payment-custom-input {
    flex: 1;
    min-width: 0;
}

.ccw-payment-add-btn {
    flex-shrink: 0;
    min-height: var(--wizard-touch-min);
    padding: 0 16px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

.ccw-payment-custom-hint {
    margin: 8px 0 0;
    font-size: 0.8rem;
    color: var(--wizard-muted, #6b7280);
}

/* Review */
.ccw-review-card {
    background: var(--wizard-card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--wizard-radius);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--wizard-shadow);
}

.ccw-review-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.ccw-review-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
}

.ccw-review-name {
    font-weight: 700;
    font-size: 1rem;
}

.ccw-review-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ccw-review-meta {
    font-size: 0.84rem;
    color: var(--wizard-muted);
    margin-bottom: 4px;
}

.ccw-review-section-title {
    margin: 12px 0 6px;
    font-size: 0.76rem;
    font-weight: 700;
    color: #667eea;
    letter-spacing: 0.02em;
}

.ccw-review-summary-list {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.84rem;
    color: var(--wizard-text);
    line-height: 1.55;
}

.ccw-review-summary-list > li {
    font-weight: 600;
}

.ccw-review-summary-list > li + li {
    margin-top: 10px;
}

.ccw-review-summary-list .ccw-yesno-summary-sublist {
    margin-top: 6px;
}

.ccw-review-row {
    font-size: 0.85rem;
    color: var(--wizard-muted);
    padding: 4px 0;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.ccw-review-row:first-of-type {
    border-top: none;
}

/* Footer */
.ccw-footer {
    position: sticky;
    bottom: 0;
    display: flex;
    gap: 10px;
    padding: 16px 0 8px;
    background: linear-gradient(to top, var(--wizard-bg) 70%, transparent);
    margin-top: 24px;
}

.ccw-footer .btn-miles-secondary,
.ccw-footer .btn-miles-primary {
    min-height: var(--wizard-touch-min);
    flex: 1;
    justify-content: center;
}

.ccw-footer .btn-miles-primary.ccw-btn-finish {
    flex: 1.4;
}

.ccw-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #b91c1c;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 0.85rem;
    margin-top: 12px;
}

.ccw-advanced-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin-top: 16px;
    padding: 14px 16px;
    border: 1px solid rgba(102, 126, 234, 0.22);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.06), rgba(118, 75, 162, 0.08));
    box-shadow: var(--wizard-shadow);
    cursor: pointer;
    text-align: left;
    transition: border-color var(--wizard-transition), background var(--wizard-transition), box-shadow var(--wizard-transition), transform var(--wizard-transition);
}

.ccw-advanced-btn:hover {
    border-color: rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.12));
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.15);
}

.ccw-advanced-btn:active {
    transform: scale(0.98);
}

.ccw-advanced-btn:focus-visible {
    outline: 2px solid var(--wizard-accent);
    outline-offset: 2px;
}

.ccw-advanced-btn-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(118, 75, 162, 0.35);
}

.ccw-advanced-btn-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.ccw-advanced-btn-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--wizard-text);
    line-height: 1.3;
}

.ccw-advanced-btn-sub {
    font-size: 0.76rem;
    color: var(--wizard-muted);
    line-height: 1.45;
}

.ccw-advanced-btn-arrow {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(102, 126, 234, 0.12);
    color: #667eea;
    font-size: 0.72rem;
    transition: background var(--wizard-transition), transform var(--wizard-transition);
}

.ccw-advanced-btn:hover .ccw-advanced-btn-arrow {
    background: rgba(102, 126, 234, 0.2);
    transform: translateX(2px);
}

.ccw-delete-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    color: #dc2626;
    cursor: pointer;
    margin-bottom: 12px;
    background: none;
    border: none;
    padding: 4px 0;
}

.ccw-loading .btn-miles-primary {
    opacity: 0.7;
    pointer-events: none;
}

.ccw-loading .btn-miles-primary i.fa-spinner {
    animation: ccwSpin 0.8s linear infinite;
}

@keyframes ccwSpin {
    to { transform: rotate(360deg); }
}

/* Dark theme */
body.dark-theme {
    --wizard-muted: #a1a1aa;
    --wizard-text: #f5f5f7;
    --wizard-bg: var(--bg-color);
    --wizard-card-bg: rgba(30, 30, 35, 0.92);
}

body.dark-theme .ccw-footer {
    background: var(--bg-color);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 -12px 32px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

body.dark-theme .ccw-footer .btn-miles-secondary {
    background: rgba(38, 38, 42, 0.98);
    border-color: rgba(255, 255, 255, 0.1);
    color: #f0f0f0;
    box-shadow: none;
}

body.dark-theme .ccw-footer .btn-miles-secondary:hover {
    background: rgba(50, 50, 56, 0.98);
    color: #fff;
}

body.dark-theme .ccw-error {
    background: rgba(239, 68, 68, 0.14);
    border-color: rgba(248, 113, 113, 0.35);
    color: #fca5a5;
}

body.dark-theme .ccw-progress-bar {
    background: rgba(255, 255, 255, 0.08);
}

body.dark-theme .ccw-input {
    background: rgba(30, 30, 35, 0.92);
    border-color: rgba(255, 255, 255, 0.08);
    color: #f5f5f7;
}

body.dark-theme .ccw-bento-card {
    background: rgba(30, 30, 35, 0.92);
    border-color: rgba(255, 255, 255, 0.08);
}

body.dark-theme .ccw-pill {
    background: rgba(30, 30, 35, 0.92);
    border-color: rgba(255, 255, 255, 0.08);
    color: #f5f5f7;
}

body.dark-theme .ccw-review-card {
    background: rgba(30, 30, 35, 0.92);
    border-color: rgba(255, 255, 255, 0.08);
}

body.dark-theme .ccw-review-section-title {
    color: #a5b4fc;
}

body.dark-theme .ccw-advanced-btn {
    border-color: rgba(102, 126, 234, 0.32);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.12), rgba(118, 75, 162, 0.14));
}

body.dark-theme .ccw-advanced-btn:hover {
    border-color: rgba(165, 180, 252, 0.45);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.18), rgba(118, 75, 162, 0.2));
}

body.dark-theme .ccw-advanced-btn-arrow {
    background: rgba(102, 126, 234, 0.22);
    color: #a5b4fc;
}

body.dark-theme .ccw-ratio-panel {
    background: rgba(30, 30, 35, 0.92);
    border-color: rgba(255, 255, 255, 0.08);
}

body.dark-theme .ccw-ratio-example {
    background: rgba(102, 126, 234, 0.14);
}

body.dark-theme .ccw-ratio-input-wrap {
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-theme .ccw-ratio-unit {
    background: rgba(255, 255, 255, 0.06);
}

body.dark-theme .ccw-yesno-summary {
    background: rgba(102, 126, 234, 0.14);
    border-color: rgba(102, 126, 234, 0.28);
}

body.dark-theme .ccw-yesno-summary-title {
    color: #a5b4fc;
}

body.dark-theme .ccw-yesno-summary-sublist {
    border-left-color: rgba(165, 180, 252, 0.25);
}

body.dark-theme .ccw-yesno-summary-sublist .ccw-yesno-summary-sublist {
    border-left-color: rgba(165, 180, 252, 0.15);
}

body.dark-theme .ccw-yesno-summary-sublist li {
    color: #94a3b8;
}

body.dark-theme .ccw-color-panel {
    background: rgba(30, 30, 35, 0.92);
    border-color: rgba(255, 255, 255, 0.08);
}

body.dark-theme .ccw-color-swatch-inner {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark-theme .ccw-color-custom-row {
    border-top-color: rgba(255, 255, 255, 0.08);
}

body.dark-theme .ccw-color-custom-ring {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.22), rgba(118, 75, 162, 0.22));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 2px 10px rgba(0, 0, 0, 0.25);
}

body.dark-theme .ccw-color-custom-icon {
    background: rgba(40, 40, 48, 0.95);
    color: #a5b4fc;
}

body.dark-theme .ccw-unit-pill {
    background: rgba(255, 255, 255, 0.08);
}

body.dark-theme .ccw-check-item {
    border-color: rgba(255, 255, 255, 0.08);
}

body.dark-theme .ccw-payment-tag {
    background: rgba(102, 126, 234, 0.18);
    border-color: rgba(102, 126, 234, 0.35);
}

body.dark-theme .ccw-payment-tag-remove:hover {
    background: rgba(255, 255, 255, 0.08);
}

body.dark-theme .ccw-intro-banner {
    background: rgba(207, 179, 120, 0.08);
    border-color: rgba(207, 179, 120, 0.2);
}

body.dark-theme .ccw-info-panel {
    background: rgba(14, 165, 233, 0.1);
    border-color: rgba(14, 165, 233, 0.2);
}

body.dark-theme .ccw-info-panel-icon {
    background: rgba(14, 165, 233, 0.18);
    color: #38bdf8;
}

body.dark-theme .ccw-info-panel-lead {
    color: #e2e8f0;
}

body.dark-theme .ccw-share-highlight {
    background: rgba(102, 126, 234, 0.14);
    border-color: rgba(102, 126, 234, 0.28);
}

body.dark-theme .ccw-store-questions {
    border-top-color: rgba(255, 255, 255, 0.08);
}

body.dark-theme .ccw-store-q-label {
    color: #e2e8f0;
}

body.dark-theme .ccw-cap-cycle-label {
    color: #e2e8f0;
}

.ccw-edit-mode-overlay {
    position: fixed;
    inset: 0;
    z-index: 12050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
}

.ccw-edit-mode-dialog {
    width: min(100%, 420px);
    background: var(--wizard-surface, #fff);
    border-radius: 20px;
    padding: 1.35rem 1.25rem 1.1rem;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
}

.ccw-edit-mode-title {
    margin: 0 0 0.35rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--wizard-text, #1e293b);
}

.ccw-edit-mode-sub {
    margin: 0 0 1rem;
    font-size: 0.86rem;
    color: var(--wizard-muted, #64748b);
}

.ccw-edit-mode-grid {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.ccw-edit-mode-card {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    width: 100%;
    padding: 0.95rem 1rem;
    border: 1.5px solid rgba(100, 116, 139, 0.18);
    border-radius: 14px;
    background: rgba(248, 250, 252, 0.9);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.ccw-edit-mode-card:hover {
    border-color: rgba(102, 126, 234, 0.45);
    background: rgba(102, 126, 234, 0.06);
    transform: translateY(-1px);
}

.ccw-edit-mode-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(102, 126, 234, 0.12);
    color: #667eea;
}

.ccw-edit-mode-card-title {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--wizard-text, #1e293b);
}

.ccw-edit-mode-card-sub {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.78rem;
    color: var(--wizard-muted, #64748b);
    line-height: 1.45;
}

.ccw-edit-mode-cancel {
    width: 100%;
    border: none;
    background: transparent;
    color: var(--wizard-muted, #64748b);
    font-size: 0.86rem;
    padding: 0.55rem;
    cursor: pointer;
}

body.dark-theme .ccw-edit-mode-dialog {
    background: #1e293b;
}

body.dark-theme .ccw-edit-mode-card {
    background: rgba(15, 23, 42, 0.55);
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-theme .ccw-edit-mode-card:hover {
    background: rgba(102, 126, 234, 0.14);
    border-color: rgba(102, 126, 234, 0.35);
}
