/**
 * Character Creation Styles
 * Theme matching My AI Model Manager Design Documentation
 * Based on Cold Onboarding styles for logged-in users (Female only)
 */

/* Monochrome wizard palette.
   Deliberately hardcoded rather than mapped onto the global theme tokens
   (--ink / --glass / --surface-sunken): those flip with theme-dark.css, and the
   wizard is meant to be a flat white page with black-and-white controls in every
   theme. Every --cc-* token below is used ONLY by this stylesheet, so retuning
   them here is what turns the whole wizard monochrome — there is no gradient,
   no glass blur and no grey fill left in the primary controls. */
:root {
    /* Background colors */
    --cc-bg: #ffffff;
    --cc-bg-secondary: #f4f4f4;
    --cc-surface: #ffffff;
    --cc-surface-hover: #f4f4f4;
    --cc-border: #e0e0e0;

    /* "Primary" is simply black now — kept as tokens so the many call sites
       across this file don't each need editing. */
    --cc-primary: #000000;
    --cc-primary-light: #000000;
    --cc-primary-dark: #000000;

    /* Text colors */
    --cc-text: #000000;
    --cc-text-secondary: #444444;
    --cc-text-muted: #6a6a6a;
    /* Label colour for controls filled with --cc-gradient / --cc-primary (now
       solid black). Those call sites used var(--ink), which is #000 in the light
       theme — black on black once the fill stopped being a light-grey gradient. */
    --cc-on-fill: #ffffff;

    /* Functional colors */
    --cc-success: #1a1a1a;
    --cc-error: #901924;
    --cc-warning: #6a6a6a;
    --cc-info: #6a6a6a;
    --cc-model-bg: #f4f4f4;

    /* Formerly a violet→grey gradient. Flat black: `background: var(--cc-gradient)`
       call sites keep working and simply render solid. */
    --cc-gradient: #000000;
    --cc-gradient-hover: #262626;

    /* Formerly glassmorphism — now plain white on a hairline border. --cc-blur
       is kept at 0 so the `backdrop-filter: blur(var(--cc-blur))` call sites
       become no-ops instead of needing removal one by one. */
    --cc-glass-bg: #ffffff;
    --cc-glass-border: #e0e0e0;
    --cc-blur: 0px;

    /* Shadows: flat design, so these collapse to hairline borders / none. */
    --cc-shadow-sm: none;
    --cc-shadow-md: none;
    --cc-shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.08);
    --cc-shadow-premium: none;

    /* Border radius from design docs */
    --cc-radius-sm: 8px;
    --cc-radius-md: 12px;
    --cc-radius-lg: 15px;
    --cc-radius-xl: 25px;
    --cc-radius-full: 50%;
}

/* The standalone wizard page (/create-character and /chat/edit/:chatId) — the
   page chrome outside .character-creation-wrapper. */
body.character-creation-page-body {
    background: #ffffff;
}

/* Wrapper */
.character-creation-wrapper {
    position: relative;
    min-height: 100%;
    background-color: var(--cc-bg);
    color: var(--cc-text);
}

.character-creation-wrapper * {
    box-sizing: border-box;
}

.character-creation-wrapper video {
    width: 100%;
}

/* Page background. Was a grey diagonal gradient plus a 15s pulsing radial
   overlay (`backgroundPulse`); both are gone — the page is flat white. The
   element is kept because the markup and the stacking context (z-index: -2,
   under the sticky footer/progress bar) still rely on it. */
.character-creation-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ffffff;
    z-index: -2;
}

/* Main Container */
.character-creation-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 560px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Progress Bar */
.character-creation-wrapper .progress-container {
    padding: 12px 0 20px;
    position: sticky;
    top: 0;
    background: var(--veil-strong);
    backdrop-filter: blur(var(--cc-blur));
    -webkit-backdrop-filter: blur(var(--cc-blur));
    z-index: 99;
    margin: 0 -16px;
    padding-left: 16px;
    padding-right: 16px;
}

.character-creation-wrapper .progress-bar-wrapper {
    height: 6px;
    background: var(--cc-glass-bg);
    border-radius: var(--cc-radius-sm);
    overflow: hidden;
    border: 1px solid var(--cc-glass-border);
}

.character-creation-wrapper .progress-bar {
    height: 100%;
    background: var(--cc-gradient);
    border-radius: var(--cc-radius-sm);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.06);
}

.step-indicator {
    text-align: center;
    margin-top: 10px;
    font-size: 0.875rem;
    color: var(--cc-text-muted);
    font-weight: 500;
}

.step-indicator .current-step {
    background: var(--cc-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

/* Steps Wrapper */
.steps-wrapper {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.step-slide {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.4s ease;
    overflow-y: auto;
    padding-bottom: 100px;
}

.step-slide.active {
    opacity: 1;
    transform: translateX(0);
    position: relative;
}

.step-slide.prev {
    transform: translateX(-100%);
}

.step-content {
    padding: 8px 0;
}

/* Step Titles */
.step-title {
    font-size: 1.75rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 12px;
    background: var(--cc-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.step-subtitle {
    font-size: 0.9375rem;
    text-align: center;
    color: var(--cc-text-secondary);
    margin-bottom: 28px;
    line-height: 1.5;
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 16px;
    color: var(--cc-text);
}

/* Selection Section */
.selection-section {
    margin-bottom: 16px;
}

/* Style Cards */
.style-cards {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.style-card {
    position: relative;
    width: calc(50% - 8px);
    max-width: 200px;
    cursor: pointer;
    border-radius: var(--cc-radius-lg);
    overflow: hidden;
    border: 2px solid var(--cc-glass-border);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: var(--cc-glass-bg);
}

.style-card:hover {
    box-shadow: var(--cc-shadow-premium);
    border-color: var(--cc-primary-light);
}

.style-card.selected {
    border-color: var(--cc-primary);
    box-shadow: var(--cc-shadow-lg);
}

.style-card-image {
    position: relative;
    aspect-ratio: 3/4;
    overflow: hidden;
}

.style-card-image img,
.style-card-image video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}


/* Video hover container */
.video-hover-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.video-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 1;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.video-hover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.video-hover-container:hover .video-thumbnail {
    opacity: 0;
}

.video-hover-container:hover .video-hover {
    opacity: 1;
}

.style-card-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    background: var(--cc-gradient);
    border-radius: var(--cc-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: var(--cc-shadow-sm);
}

.style-card.selected .style-card-overlay {
    opacity: 1;
    transform: scale(1);
}

.style-card-overlay i {
    color: var(--ink);
    font-size: 0.875rem;
}

.style-card-label {
    display: block;
    text-align: center;
    padding: 14px;
    font-weight: 600;
    color: var(--cc-text);
    background: linear-gradient(0deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.4) 60%, transparent 100%);
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
}

/* Selected: the label scrim inverts to black-on-white text. (Was a grey scrim
   that left the label mid-grey on mid-grey and barely read as "selected".) */
.style-card.selected .style-card-label {
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.5) 60%, transparent 100%);
    color: #ffffff;
}

/* Ethnicity Grid */
.ethnicity-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.ethnicity-card {
    position: relative;
    aspect-ratio: 3/4;
    border-radius: var(--cc-radius-md);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid var(--cc-glass-border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--cc-glass-bg);
}

.ethnicity-card:hover {
    border-color: var(--cc-primary-light);
    box-shadow: var(--cc-shadow-md);
}

.ethnicity-card.selected {
    border-color: var(--cc-primary);
    box-shadow: var(--cc-shadow-lg);
}

.ethnicity-card img,
.ethnicity-card video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.ethnicity-card:hover img,
.ethnicity-card:hover video {
    transform: scale(1.05);
}

.ethnicity-card .video-hover-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.ethnicity-card span {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px;
    background: linear-gradient(0deg, rgba(255, 255, 255, 0.85) 0%, transparent 100%);
    color: var(--cc-text);
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
}

.ethnicity-card.selected span {
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.88) 0%, transparent 100%);
    color: #ffffff;
}

/* Check Badge */
.check-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: var(--cc-gradient);
    border-radius: var(--cc-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: var(--cc-shadow-sm);
}

.ethnicity-card.selected .check-badge,
.hair-style-card.selected .check-badge,
.hair-color-card.selected .check-badge,
.body-type-card.selected .check-badge,
.breast-size-card.selected .check-badge,
.butt-size-card.selected .check-badge,
.build-card.selected .check-badge,
.gender-card.selected .check-badge,
.voice-card.selected .check-badge,
.generated-image-item.selected .image-overlay {
    opacity: 1;
    transform: scale(1);
}

/* White tick on the now-black badge. Was var(--ink), which is #000 in the light
   theme — black on a black badge. */
.check-badge i {
    color: #ffffff;
    font-size: 0.75rem;
}

/* Age Selector */
.age-selector {
    background: var(--cc-glass-bg);
    backdrop-filter: blur(var(--cc-blur));
    -webkit-backdrop-filter: blur(var(--cc-blur));
    border: 1px solid var(--cc-glass-border);
    border-radius: var(--cc-radius-lg);
    padding: 24px;
}

.age-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}

.age-label {
    color: var(--cc-text-secondary);
    font-size: 0.9375rem;
}

.age-value {
    font-size: 1.75rem;
    font-weight: 700;
    background: var(--cc-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    padding: 6px 20px;
    border-radius: var(--cc-radius-sm);
    border: 2px solid var(--cc-primary);
    box-shadow: var(--cc-shadow-sm);
}

.age-unit {
    color: var(--cc-text-secondary);
    font-size: 0.9375rem;
}

.age-slider {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    background: var(--cc-glass-border);
    border-radius: var(--cc-radius-sm);
    outline: none;
}

.age-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 28px;
    height: 28px;
    background: var(--cc-gradient);
    border-radius: var(--cc-radius-full);
    cursor: pointer;
    box-shadow: var(--cc-shadow-md);
    transition: transform 0.2s ease;
}

.age-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.age-slider::-moz-range-thumb {
    width: 28px;
    height: 28px;
    background: var(--cc-gradient);
    border-radius: var(--cc-radius-full);
    cursor: pointer;
    border: none;
    box-shadow: var(--cc-shadow-md);
}

/* Hair Style Grid */
.hair-style-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.hair-style-card {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--cc-radius-md);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid var(--cc-glass-border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--cc-glass-bg);
}

.hair-style-card:hover {
    border-color: var(--cc-primary-light);
    transform: translateY(-4px);
    box-shadow: var(--cc-shadow-md);
}

.hair-style-card.selected {
    border-color: var(--cc-primary);
    box-shadow: var(--cc-shadow-lg);
}

.hair-style-card img,
.hair-style-card video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.hair-style-card:hover img,
.hair-style-card:hover video {
    transform: scale(1.05);
}

.hair-style-card .video-hover-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.hair-style-card span {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px;
    background: linear-gradient(0deg, rgba(255, 255, 255, 0.85) 0%, transparent 100%);
    color: var(--cc-text);
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
}

/* Hair Color Strip */
.hair-color-strip {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    padding: 8px 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.hair-color-strip::-webkit-scrollbar {
    display: none;
}

.hair-color-card {
    position: relative;
    flex: 0 0 80px;
    height: 100px;
    border-radius: var(--cc-radius-md);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid var(--cc-glass-border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--cc-glass-bg);
}

.hair-color-card:hover {
    border-color: var(--cc-primary-light);
    transform: translateY(-4px);
    box-shadow: var(--cc-shadow-md);
}

.hair-color-card.selected {
    border-color: var(--cc-primary);
    box-shadow: var(--cc-shadow-lg);
}

.hair-color-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hair-color-card span {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 6px;
    background: linear-gradient(0deg, rgba(255, 255, 255, 0.8) 0%, transparent 100%);
    color: var(--cc-text);
    font-size: 0.625rem;
    font-weight: 500;
    text-align: center;
}

/* Body Type Grid */
.body-type-grid {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    padding: 8px 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.body-type-grid::-webkit-scrollbar {
    display: none;
}

.body-type-card {
    position: relative;
    flex: 0 0 100px;
    height: 140px;
    border-radius: var(--cc-radius-md);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid var(--cc-glass-border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--cc-glass-bg);
}

.body-type-card:hover {
    border-color: var(--cc-primary-light);
    transform: translateY(-4px);
    box-shadow: var(--cc-shadow-md);
}

.body-type-card.selected {
    border-color: var(--cc-primary);
    box-shadow: var(--cc-shadow-lg);
}

.body-type-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.body-type-card span {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px;
    background: linear-gradient(0deg, rgba(255, 255, 255, 0.8) 0%, transparent 100%);
    color: var(--cc-text);
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
}

/* Breast & Butt Size Grids */
.breast-size-grid,
.butt-size-grid {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    padding: 8px 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.breast-size-grid::-webkit-scrollbar,
.butt-size-grid::-webkit-scrollbar {
    display: none;
}

.breast-size-card,
.butt-size-card {
    position: relative;
    flex: 0 0 90px;
    height: 120px;
    border-radius: var(--cc-radius-md);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid var(--cc-glass-border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--cc-glass-bg);
}

.breast-size-card:hover,
.butt-size-card:hover {
    border-color: var(--cc-primary-light);
    transform: translateY(-4px);
    box-shadow: var(--cc-shadow-md);
}

.breast-size-card.selected,
.butt-size-card.selected {
    border-color: var(--cc-primary);
    box-shadow: var(--cc-shadow-lg);
}

.breast-size-card img,
.butt-size-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.breast-size-card span,
.butt-size-card span {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 6px;
    background: linear-gradient(0deg, rgba(255, 255, 255, 0.8) 0%, transparent 100%);
    color: var(--cc-text);
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
}

/* Build grid (male) — same look as breast/butt grids */
.build-grid {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    padding: 8px 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

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

.build-card {
    position: relative;
    flex: 0 0 90px;
    height: 120px;
    border-radius: var(--cc-radius-md);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid var(--cc-glass-border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--cc-glass-bg);
}

.build-card:hover {
    border-color: var(--cc-primary-light);
    transform: translateY(-4px);
    box-shadow: var(--cc-shadow-md);
}

.build-card.selected {
    border-color: var(--cc-primary);
    box-shadow: var(--cc-shadow-lg);
}

.build-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.build-card span {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 6px;
    background: linear-gradient(0deg, rgba(255, 255, 255, 0.8) 0%, transparent 100%);
    color: var(--cc-text);
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
}

/* Gender toggle (Woman / Man) */
.gender-grid {
    display: flex;
    gap: 12px;
    padding: 8px 0;
}

.gender-card {
    position: relative;
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 84px;
    padding: 16px 12px;
    border-radius: var(--cc-radius-md);
    cursor: pointer;
    border: 2px solid var(--cc-glass-border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--cc-glass-bg);
    color: var(--cc-text);
}

.gender-card:hover {
    border-color: var(--cc-primary-light);
    transform: translateY(-2px);
    box-shadow: var(--cc-shadow-md);
}

.gender-card.selected {
    border-color: var(--cc-primary);
    box-shadow: var(--cc-shadow-lg);
}

/* The ♀/♂ glyph. Scoped with `>` on purpose: the tick inside .check-badge is
   also an `i:first-child` inside .gender-card, so an unscoped selector won this
   at (0,2,1) over `.check-badge i` (0,1,1) and painted the tick the same colour
   as the now-black badge — an invisible checkmark on the selected card. */
.gender-card > i:first-child {
    font-size: 1.6rem;
    color: var(--cc-primary-light);
}

.gender-card span {
    font-size: 0.9rem;
    font-weight: 600;
}

/* Name Input */
.name-input-group {
    display: flex;
    gap: 12px;
    background: var(--cc-glass-bg);
    backdrop-filter: blur(var(--cc-blur));
    -webkit-backdrop-filter: blur(var(--cc-blur));
    border: 1px solid var(--cc-glass-border);
    border-radius: var(--cc-radius-md);
    padding: 6px;
    margin-bottom: 28px;
}

.name-input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 14px 18px;
    color: var(--cc-text);
    font-size: 1rem;
    outline: none;
}

.name-input::placeholder {
    color: var(--cc-text-muted);
}

.name-input:focus {
    color: var(--cc-text);
}

.generate-name-btn {
    background: var(--cc-gradient);
    border: none;
    padding: 14px 18px;
    border-radius: var(--cc-radius-sm);
    color: var(--cc-on-fill);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.generate-name-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--cc-shadow-md);
}

.generate-name-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.generate-name-btn i.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Custom Prompt */
.custom-prompt-container {
    background: var(--cc-glass-bg);
    backdrop-filter: blur(var(--cc-blur));
    -webkit-backdrop-filter: blur(var(--cc-blur));
    border: 1px solid var(--cc-glass-border);
    border-radius: var(--cc-radius-md);
    padding: 16px;
}

.custom-prompt-label {
    display: block;
    font-size: 0.875rem;
    color: var(--cc-text-secondary);
    margin-bottom: 10px;
}

.custom-prompt-input {
    width: 100%;
    background: transparent;
    border: 1px solid var(--cc-glass-border);
    border-radius: var(--cc-radius-sm);
    padding: 12px;
    color: var(--cc-text);
    font-size: 0.9375rem;
    resize: none;
    outline: none;
}

.custom-prompt-input:focus {
    border-color: var(--cc-primary);
}

.custom-prompt-input::placeholder {
    color: var(--cc-text-muted);
}

/* Personality Grid */
/* Personal / Professional mode toggle */
.character-mode-toggle {
    display: flex;
    gap: 6px;
    padding: 6px;
    margin: 0 auto 20px;
    max-width: 360px;
    background: var(--cc-glass-bg);
    border: 1px solid var(--cc-glass-border);
    border-radius: var(--cc-radius-xl);
    backdrop-filter: blur(var(--cc-blur));
}

.character-mode-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border: none;
    background: transparent;
    color: var(--cc-text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--cc-radius-xl);
    cursor: pointer;
    transition: all 0.2s ease;
}

.character-mode-btn i {
    font-size: 0.95rem;
}

.character-mode-btn:hover {
    color: var(--cc-text);
    background: var(--cc-surface-hover);
}

.character-mode-btn.active {
    color: var(--cc-on-fill);
    background: var(--cc-gradient);
    box-shadow: var(--cc-shadow-md);
}

.personality-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    position: relative;
}

.personality-option-card {
    background: var(--cc-glass-bg);
    backdrop-filter: blur(var(--cc-blur));
    -webkit-backdrop-filter: blur(var(--cc-blur));
    border: 1px solid var(--cc-glass-border);
    border-radius: var(--cc-radius-md);
    padding: 18px;
    cursor: pointer;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.personality-option-card:hover {
    background: var(--cc-surface-hover);
    border-color: var(--cc-primary-light);
    transform: translateY(-2px);
    box-shadow: var(--cc-shadow-sm);
}

.personality-option-card .option-label {
    display: block;
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--cc-text-muted);
    margin-bottom: 6px;
}

.personality-option-card .option-value {
    display: block;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--cc-text);
}

.personality-option-card .edit-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    background: var(--cc-glass-border);
    border: none;
    width: 30px;
    height: 30px;
    border-radius: var(--cc-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cc-text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.personality-option-card .edit-btn:hover {
    background: var(--cc-gradient);
    color: var(--cc-on-fill);
    box-shadow: var(--cc-shadow-sm);
}

/* Voice Grid */
.voice-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.voice-card {
    background: var(--cc-glass-bg);
    backdrop-filter: blur(var(--cc-blur));
    -webkit-backdrop-filter: blur(var(--cc-blur));
    border: 1px solid var(--cc-glass-border);
    border-radius: var(--cc-radius-md);
    padding: 18px;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.voice-card:hover {
    border-color: var(--cc-primary-light);
    background: var(--cc-surface-hover);
    transform: translateY(-2px);
    box-shadow: var(--cc-shadow-sm);
}

.voice-card.selected {
    border-color: var(--cc-primary);
    background: var(--glass-strong);
    box-shadow: var(--cc-shadow-md);
}

.voice-card-content {
    display: flex;
    align-items: center;
    gap: 14px;
}

.voice-icon {
    width: 52px;
    height: 52px;
    background: var(--cc-gradient);
    border-radius: var(--cc-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--cc-shadow-sm);
}

.voice-icon i {
    font-size: 1.25rem;
    color: var(--ink);
}

.voice-info {
    flex: 1;
}

.voice-name {
    display: block;
    font-weight: 600;
    color: var(--cc-text);
    margin-bottom: 4px;
}

.voice-description {
    display: block;
    font-size: 0.75rem;
    color: var(--cc-text-secondary);
}

.play-sample-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--cc-glass-bg);
    border: 1px solid var(--cc-glass-border);
    padding: 12px 18px;
    border-radius: var(--cc-radius-sm);
    color: var(--cc-text);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    z-index: 10;
}

.play-sample-btn:hover {
    background: var(--cc-gradient);
    border-color: transparent;
    box-shadow: var(--cc-shadow-sm);
}

.play-sample-btn:active {
    transform: scale(0.98);
}

.play-sample-btn.playing {
    background: var(--cc-gradient);
    border-color: transparent;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.voice-card .check-badge {
    top: 18px;
    right: 18px;
}

/* ===================================
   MODEL SELECTION SECTION
   =================================== */
.model-selection-section {
    margin-bottom: 30px;
    padding: 18px;
    background: var(--glass-strong);
    border: 1px solid rgba(0, 0, 0, 0.14);
    border-radius: var(--cc-radius-lg);
}

.model-selection-section .section-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--cc-text);
    margin-bottom: 15px;
}

/* Model Provider Tabs */
.model-provider-tabs,
.model-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    padding: 4px;
    background: var(--veil);
    border: 1px solid var(--cc-glass-border);
    border-radius: var(--cc-radius-md);
}

.model-provider-tab,
.model-tab {
    flex: 1;
    padding: 11px 14px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--cc-radius-sm);
    color: var(--cc-text-secondary);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.model-provider-tab:hover,
.model-provider-tab:focus-visible,
.model-tab:hover {
    background: var(--cc-surface-hover);
    border-color: var(--cc-primary);
    color: var(--cc-text);
    outline: none;
}

.model-provider-tab.active,
.model-tab.active {
    background: var(--cc-gradient);
    border-color: var(--line-strong);
    color: var(--cc-on-fill);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.06);
}

.model-count-badge {
    background: var(--cc-primary);
    color: var(--cc-on-fill);
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* Model Tab Content */
.model-tab-content {
    position: relative;
    min-height: 108px;
}

.model-pane {
    display: none;
}

.model-pane.active {
    display: block;
}

/* Models Scroll Container */
.models-scroll-container {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 10px 5px 12px;
    margin: -10px -5px 0;
    scrollbar-width: thin;
    scrollbar-color: var(--cc-primary) transparent;
}

.models-scroll-container::-webkit-scrollbar {
    height: 6px;
}

.models-scroll-container::-webkit-scrollbar-track {
    background: transparent;
}

.models-scroll-container::-webkit-scrollbar-thumb {
    background: var(--cc-primary);
    border-radius: 3px;
}

/* Model Style Item (system models) */
.model-style-item {
    flex-shrink: 0;
}

.model-style-item .style-option {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--cc-radius-sm);
    border: 2px solid rgba(0, 0, 0, 0.18);
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--cc-model-bg);
}

.model-style-item .style-option:hover {
    border-color: var(--cc-primary-light);
    transform: scale(1.05);
}

.model-style-item .style-option.selected {
    border-color: var(--cc-primary);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.06);
}

.model-style-item .style-option.is-premium {
    opacity: 0.5;
    cursor: not-allowed;
}

.model-style-item .badge {
    font-size: 0.65rem;
    padding: 3px 5px;
}

/* Add Custom Model Card */
.add-model-card {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border: 2px dashed var(--cc-glass-border);
    border-radius: var(--cc-radius-sm);
    background: var(--cc-glass-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.add-model-card:hover {
    border-color: var(--cc-primary);
    background: var(--cc-surface-hover);
}

.add-model-card i {
    font-size: 1.5rem;
    color: var(--cc-text-muted);
}

.add-model-card span {
    font-size: 0.6rem;
    color: var(--cc-text-muted);
    text-align: center;
    line-height: 1.2;
}

/* Premium Notice */
.premium-notice {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: var(--cc-glass-bg);
    border: 1px solid var(--cc-glass-border);
    border-radius: var(--cc-radius-md);
    margin-bottom: 15px;
}

.premium-notice > i {
    font-size: 1.5rem;
    color: var(--cc-primary);
}

.premium-notice-content {
    flex: 1;
}

.premium-notice-content strong {
    display: block;
    margin-bottom: 5px;
    color: var(--cc-text);
}

.premium-notice-content p {
    font-size: 0.85rem;
    color: var(--cc-text-secondary);
    margin-bottom: 10px;
}

.premium-notice .btn-upgrade {
    display: inline-block;
    padding: 6px 16px;
    background: var(--cc-gradient);
    color: var(--cc-on-fill);
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: var(--cc-radius-sm);
    text-decoration: none;
    transition: all 0.2s ease;
}

.premium-notice .btn-upgrade:hover {
    background: var(--cc-gradient-hover);
    box-shadow: var(--cc-shadow-sm);
}

/* Style Filter Buttons (dynamically inserted) */
#styleFilterContainer {
    margin-bottom: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

#styleFilterContainer .style-filter-btn {
    padding: 6px 14px;
    font-size: 0.8rem;
    background: var(--cc-glass-bg);
    border: 1px solid var(--cc-glass-border);
    border-radius: var(--cc-radius-sm);
    color: var(--cc-text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

#styleFilterContainer .style-filter-btn:hover {
    border-color: var(--cc-primary);
    color: var(--cc-text);
}

#styleFilterContainer .style-filter-btn.active {
    background: var(--cc-gradient);
    border-color: transparent;
    color: var(--cc-on-fill);
}

/* Base Face Upload Section */
.base-face-upload-section {
    margin-bottom: 25px;
}

.base-face-upload-section .section-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--cc-text);
    margin-bottom: 8px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
}

.base-face-upload-section .section-label .text-muted {
    font-size: 0.85rem;
    font-weight: 400;
}

.base-face-upload-section .section-description {
    font-size: 0.85rem;
    color: var(--cc-text-muted);
    margin-bottom: 15px;
    line-height: 1.4;
    text-align: left;
}

.base-face-upload-area {
    position: relative;
}

.base-face-upload-area .upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    background: var(--cc-glass-bg);
    border: 2px dashed var(--cc-glass-border);
    border-radius: var(--cc-radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.base-face-upload-area .upload-placeholder:hover {
    border-color: var(--cc-primary);
    background: var(--cc-surface-hover);
}

.base-face-upload-area.drag-over .upload-placeholder {
    border-color: var(--cc-primary);
    background: var(--cc-surface-hover);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
}

.base-face-upload-area .upload-placeholder i {
    font-size: 2.5rem;
    color: var(--cc-primary-light);
    margin-bottom: 10px;
}

.base-face-upload-area .upload-text {
    color: var(--cc-text);
    font-size: 0.95rem;
    margin-bottom: 5px;
}

.base-face-upload-area .upload-hint {
    color: var(--cc-text-muted);
    font-size: 0.8rem;
}

.base-face-upload-area .face-preview {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    background: var(--cc-glass-bg);
    border: 2px solid var(--cc-primary);
    border-radius: var(--cc-radius-md);
}

.base-face-upload-area .face-preview img {
    max-width: 150px;
    max-height: 150px;
    width: auto;
    height: auto;
    border-radius: var(--cc-radius-md);
    object-fit: cover;
    margin-bottom: 10px;
}

.base-face-upload-area .btn-clear-face {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--cc-error);
    border-radius: var(--cc-radius-sm);
    color: var(--cc-error);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.base-face-upload-area .btn-clear-face:hover {
    background: var(--cc-error);
    color: var(--ink);
}

/* Custom Prompt Section */
.custom-prompt-section {
    margin-bottom: 25px;
}

.custom-prompt-section .section-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--cc-text);
    margin-bottom: 8px;
    text-align: left;
}

.custom-prompt-description {
    font-size: 0.85rem;
    color: var(--cc-text-muted);
    margin-bottom: 10px;
    line-height: 1.4;
    text-align: left;
}

.custom-prompt-input {
    width: 100%;
    padding: 12px 15px;
    background: var(--cc-glass-bg);
    border: 1px solid var(--cc-glass-border);
    border-radius: var(--cc-radius-md);
    color: var(--cc-text);
    font-size: 0.9rem;
    font-family: inherit;
    resize: none;
    transition: all 0.2s ease;
}

.custom-prompt-input::placeholder {
    color: var(--cc-text-muted);
}

.custom-prompt-input:focus {
    outline: none;
    border-color: var(--cc-primary);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.06);
}

.custom-prompt-section .char-counter {
    text-align: right;
    font-size: 0.75rem;
    color: var(--cc-text-muted);
    margin-top: 5px;
}

/* Image Generation Section */
.image-generation-section {
    text-align: center;
}

/* Generation Progress Container */
.generated-images-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
    min-height: 200px;
}

/* 4-image placeholder grid */
.image-placeholder-grid {
    display: contents;
}

.placeholder-item {
    aspect-ratio: 1;
    background: var(--cc-glass-bg);
    border: 2px dashed var(--cc-glass-border);
    border-radius: var(--cc-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder-item .placeholder-content {
    text-align: center;
    color: var(--cc-text-muted);
}

.placeholder-item .placeholder-content i {
    font-size: 2rem;
    opacity: 0.5;
}

/* Loading state for placeholder */
.image-placeholder-grid.loading .placeholder-item {
    border-style: solid;
    animation: pulse 1.5s ease-in-out infinite;
}

.image-placeholder-grid.loading .placeholder-content i {
    display: none;
}

.image-placeholder-grid.loading .placeholder-item::after {
    content: '';
    width: 24px;
    height: 24px;
    border: 2px solid var(--cc-primary-light);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Legacy single placeholder support */
.image-placeholder {
    grid-column: span 2;
    aspect-ratio: 1;
    background: var(--cc-glass-bg);
    border: 2px dashed var(--cc-glass-border);
    border-radius: var(--cc-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder-content {
    text-align: center;
    color: var(--cc-text-muted);
}

.placeholder-content i {
    font-size: 3rem;
    margin-bottom: 12px;
    display: block;
}

.placeholder-content span {
    font-size: 0.9375rem;
}

.generated-image-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--cc-radius-md);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid var(--cc-glass-border);
    transition: all 0.3s ease;
}

.generated-image-item:hover {
    border-color: var(--cc-primary-light);
    transform: scale(1.02);
}

.generated-image-item.selected {
    border-color: var(--cc-primary);
    box-shadow: var(--cc-shadow-lg);
}

.generated-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.generated-image-item .image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--scrim-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.generated-image-item .image-overlay i {
    font-size: 2.5rem;
    color: var(--ink);
}

.image-generation-controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
}

.btn-generate-image,
.btn-regenerate-image {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--cc-gradient);
    border: none;
    padding: 16px 32px;
    border-radius: var(--cc-radius-xl);
    color: var(--cc-on-fill);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-generate-image:hover,
.btn-regenerate-image:hover {
    transform: translateY(-2px);
    box-shadow: var(--cc-shadow-premium);
}

.btn-generate-image:disabled,
.btn-regenerate-image:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-regenerate-image {
    background: transparent;
    border: 1px solid var(--cc-glass-border);
    color: var(--cc-text);
}

.btn-regenerate-image:hover {
    background: var(--cc-glass-bg);
    border-color: var(--cc-primary-light);
}

.image-selection-info {
    font-size: 0.875rem;
    color: var(--cc-text-secondary);
}

/* Coin price of a generation, shown on the generation step. Creating a
   character is open to every user and paid for in coins, so the price is
   stated up front rather than discovered when the balance runs out. */
.cc-cost-note {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: -4px 0 8px;
    padding: 4px 12px;
    border: 1px solid var(--cc-glass-border);
    border-radius: 999px;
    background: var(--cc-glass-bg);
    color: var(--cc-text-secondary);
    font-size: 0.8125rem;
}

/* Post-generation licence offer. Sits between Regenerate and Start Chat: the
   character already belongs to the user, this is the optional next step that
   puts her to work (docs/AGENT_LICENSING.md). */
.character-license-cta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 20px auto 0;
    max-width: 640px;
    padding: 16px 20px;
    border: 1px solid var(--cc-glass-border);
    border-radius: var(--cc-radius-lg);
    background: var(--cc-glass-bg);
    backdrop-filter: blur(var(--cc-blur));
    -webkit-backdrop-filter: blur(var(--cc-blur));
    text-align: left;
}

.character-license-cta .cl-cta-icon {
    flex: 0 0 auto;
    font-size: 1.5rem;
    color: var(--cc-primary-light);
    line-height: 1;
}

.character-license-cta .cl-cta-body {
    flex: 1 1 auto;
    min-width: 0;
}

.character-license-cta .cl-cta-title {
    margin: 0 0 4px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--cc-text);
}

.character-license-cta .cl-cta-text {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--cc-text-secondary);
}

.character-license-cta .cl-cta-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1px solid var(--cc-glass-border);
    border-radius: var(--cc-radius-xl);
    background: transparent;
    color: var(--cc-text);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.25s ease;
}

.character-license-cta .cl-cta-btn:hover {
    background: var(--cc-glass-bg);
    border-color: var(--cc-primary-light);
    transform: translateY(-1px);
}

@media (max-width: 640px) {
    .character-license-cta {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
    .character-license-cta .cl-cta-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Character Summary */
.character-summary {
    background: var(--cc-glass-bg);
    backdrop-filter: blur(var(--cc-blur));
    -webkit-backdrop-filter: blur(var(--cc-blur));
    border: 1px solid var(--cc-glass-border);
    border-radius: var(--cc-radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    display: flex;
    gap: 20px;
    align-items: center;
}

.summary-image-container {
    flex: 0 0 100px;
}

.summary-image-container img {
    width: 100px;
    height: 100px;
    border-radius: var(--cc-radius-md);
    object-fit: cover;
    border: 2px solid var(--cc-primary);
}

.summary-details {
    flex: 1;
    text-align: left;
}

.summary-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--cc-text);
    margin: 0 0 8px 0;
}

.summary-traits {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.trait-badge {
    background: var(--cc-gradient);
    color: var(--cc-on-fill);
    padding: 4px 12px;
    border-radius: var(--cc-radius-xl);
    font-size: 0.75rem;
    font-weight: 500;
}

.summary-description {
    font-size: 0.875rem;
    color: var(--cc-text-secondary);
    margin: 0;
}

/* Character Summary Card - Native App Style */
.character-summary-card {
    background: var(--cc-glass-bg);
    backdrop-filter: blur(var(--cc-blur));
    -webkit-backdrop-filter: blur(var(--cc-blur));
    border: 1px solid var(--cc-glass-border);
    border-radius: var(--cc-radius-lg);
    padding: 20px;
    margin-bottom: 24px;
}

.summary-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--cc-glass-border);
}

.summary-avatar-container {
    flex: 0 0 80px;
}

.summary-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--cc-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.summary-header-info {
    flex: 1;
}

.summary-header-info .summary-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--cc-text);
    margin: 0 0 8px 0;
}

.summary-stats {
    display: flex;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--cc-text-secondary);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-item i {
    color: var(--cc-primary-light);
}

.summary-details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.summary-detail-card {
    background: var(--glass);
    border: 1px solid var(--cc-glass-border);
    border-radius: var(--cc-radius-md);
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.summary-detail-card .detail-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--cc-text-muted);
    font-weight: 500;
}

.summary-detail-card .detail-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--cc-text);
}

.summary-purpose-section {
    background: var(--glass);
    border: 1px solid var(--cc-glass-border);
    border-radius: var(--cc-radius-md);
    padding: 16px;
}

.summary-purpose-section .detail-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--cc-text-muted);
    font-weight: 500;
    display: block;
    margin-bottom: 8px;
}

.summary-purpose-section .purpose-text {
    font-size: 0.9rem;
    color: var(--cc-text-secondary);
    margin: 0;
    line-height: 1.5;
}

@media (max-width: 480px) {
    .summary-details-grid {
        grid-template-columns: 1fr;
    }
    
    .summary-header {
        flex-direction: column;
        text-align: center;
    }
    
    .summary-stats {
        justify-content: center;
    }
}

/* Start Chat Section */
.start-chat-section {
    text-align: center;
}

.btn-start-chat {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: var(--cc-gradient);
    border: none;
    padding: 18px 48px;
    border-radius: var(--cc-radius-xl);
    color: var(--cc-on-fill);
    font-size: 1.125rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--cc-shadow-md);
}

.btn-start-chat:hover {
    transform: translateY(-3px);
    box-shadow: var(--cc-shadow-premium);
}

.btn-start-chat i {
    font-size: 1.25rem;
}

/* Footer Navigation — Back · step indicator · Next.
   Flat white bar, hairline top rule, no blur. Back and Next sit at the two
   edges and are sized by their content (the label changes per step — "Next",
   "Generate Images", "Start Chat"), so the indicator is absolutely centred on
   the footer rather than flex-centred between them: that keeps it on the page's
   centre line instead of shifting every time a label changes width. */
.character-creation-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-top: 1px solid var(--cc-glass-border);
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    z-index: 100;
}

/* Shared base for the two nav buttons. They deliberately do not carry
   Bootstrap's `.btn` class (see the comment in character-creation.hbs), so this
   supplies the resets `.btn` would have given. */
.character-creation-footer .cc-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 24px;
    border-radius: var(--cc-radius-xl);
    font-family: inherit;
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.3;
    cursor: pointer;
    text-align: center;
    /* Content-sized and never wrapping — the labels change per step. */
    flex: 0 0 auto;
    white-space: nowrap;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
}

/* Back — white with a black outline. `visibility: hidden` (set inline by
   updateUI on step 1) keeps it occupying its slot, so the step indicator does
   not jump sideways between steps. */
.character-creation-wrapper .btn-back {
    background: #ffffff;
    border: 1.5px solid #000000;
    color: #000000;
}

.character-creation-wrapper .btn-back:hover {
    background: #000000;
    color: #ffffff;
}

.character-creation-wrapper .btn-back:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.character-creation-wrapper .btn-back:disabled:hover {
    background: #ffffff;
    color: #000000;
}

/* Next — solid black, inverting to outlined-black on hover. */
.character-creation-wrapper .btn-next {
    background: #000000;
    border: 1.5px solid #000000;
    color: #ffffff;
    min-width: 130px;
}

.character-creation-wrapper .btn-next:hover:not(:disabled) {
    background: #ffffff;
    color: #000000;
}

.character-creation-wrapper .btn-next:disabled {
    background: #ffffff;
    color: #000000;
    opacity: 0.35;
    cursor: not-allowed;
}

/* ── Footer step indicator ("2 / 6" + dots) ───────────────────────────────
   Sits between Back and Next. `.cc-step-dot.done` marks every step already
   passed, `.is-current` the one being shown, so the row reads as progress
   toward completion rather than a bare counter. Filled by updateUI(). */
.cc-step-indicator {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    user-select: none;
    pointer-events: none;
}

.cc-step-count {
    font-size: 0.8rem;
    font-weight: 700;
    color: #000000;
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
}

.cc-step-count .cc-step-total {
    color: var(--cc-text-muted);
    font-weight: 600;
}

.cc-step-dots {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cc-step-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ffffff;
    border: 1.5px solid #000000;
    opacity: 0.3;
    transition: opacity 0.2s ease, background 0.2s ease, width 0.2s ease;
}

.cc-step-dot.done {
    background: #000000;
    opacity: 1;
}

/* The current step reads as a filled pill, so it is distinguishable from the
   completed dots at a glance without using colour. */
.cc-step-dot.is-current {
    background: #000000;
    opacity: 1;
    width: 18px;
    border-radius: 4px;
}

/* Narrow screens: the step labels get long ("Generate Images", "Start Chat")
   and a centre-absolute indicator ends up sitting on top of the Next button.
   Below 560px the footer becomes two rows instead — indicator on top (back in
   normal flow, `order: -1`), Back and Next beneath it. */
@media (max-width: 560px) {
    .character-creation-footer {
        flex-wrap: wrap;
        row-gap: 10px;
        padding: 12px 16px calc(14px + env(safe-area-inset-bottom, 0px));
    }

    .cc-step-indicator {
        position: static;
        transform: none;
        order: -1;
        flex: 1 0 100%;
        flex-direction: row;
        justify-content: center;
        gap: 10px;
    }

    .character-creation-footer .cc-nav-btn {
        padding: 12px 18px;
        font-size: 0.95rem;
    }
}

/* Option Picker Modal */
.option-picker-modal .modal-content {
    background: var(--surface-overlay);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--cc-glass-border);
    border-radius: var(--cc-radius-xl);
}

.option-picker-modal .modal-header {
    border-bottom: 1px solid var(--cc-glass-border);
    padding: 18px 24px;
}

.option-picker-modal .modal-title {
    color: var(--cc-text);
    font-weight: 600;
    font-size: 1.125rem;
}

.option-picker-modal .btn-close {
    filter: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3E%3Cpath fill-rule='evenodd' d='M10.854 4.146a.5.5 0 0 1 0 .708L6.707 8l4.147 4.146a.5.5 0 0 1-.708.708l-4.5-4.5a.5.5 0 0 1 0-.708l4.5-4.5a.5.5 0 0 1 .708 0z'/%3E%3C/svg%3E") !important;
}

.option-picker-modal .modal-body {
    padding: 16px;
}

.option-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.option-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 18px;
    background: var(--cc-glass-bg);
    border: 1px solid var(--cc-glass-border);
    border-radius: var(--cc-radius-md);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.option-item:hover {
    background: var(--cc-surface-hover);
    border-color: var(--cc-primary-light);
    transform: translateX(4px);
}

.option-item.selected {
    background: var(--scrim-soft);
    border-color: var(--cc-primary);
}

.option-item span {
    color: var(--cc-text);
    font-size: 0.9375rem;
}

.option-item i {
    color: var(--cc-primary);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.option-item.selected i {
    opacity: 1;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--veil-strong);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
}

.loading-content .spinner-border {
    width: 52px;
    height: 52px;
    margin-bottom: 20px;
    border-width: 3px;
    color: var(--cc-primary-light) !important;
}

.loading-content p {
    background: var(--cc-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.loading-content small {
    color: var(--cc-text-secondary);
    font-size: 0.9375rem;
}

/* Error Toast */
.error-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--cc-error);
    color: var(--ink);
    padding: 14px 24px;
    border-radius: var(--cc-radius-md);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9375rem;
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.error-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Responsive */
@media (min-width: 768px) {
    .character-creation-container {
        max-width: 640px;
    }
    
    .ethnicity-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .hair-style-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 375px) {
    .step-title {
        font-size: 1.25rem;
    }
    
    .style-card {
        max-width: 140px;
    }
    
    .character-summary {
        flex-direction: column;
        text-align: center;
    }
    
    .summary-details {
        text-align: center;
    }
}

/* Option Picker Popup */
.option-picker-popup {
    background: var(--cc-bg-secondary);
    border: 1px solid var(--cc-glass-border);
    border-radius: var(--cc-radius-lg);
    box-shadow: var(--cc-shadow-lg);
    z-index: 100;
    overflow: hidden;
    animation: popupSlideIn 0.2s ease-out;
    max-height: 300px;
    display: flex;
    flex-direction: column;
}

@keyframes popupSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.option-picker-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--cc-glass-border);
    background: var(--cc-glass-bg);
}

.option-picker-popup-header span {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--cc-text);
}

.popup-close-btn {
    background: transparent;
    border: none;
    color: var(--cc-text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--cc-radius-sm);
    transition: all 0.2s ease;
}

.popup-close-btn:hover {
    color: var(--cc-text);
    background: var(--cc-surface-hover);
}

.option-picker-popup-body {
    padding: 8px;
    overflow-y: auto;
    flex: 1;
}

.popup-option-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-radius: var(--cc-radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--cc-text);
}

.popup-option-item:hover {
    background: var(--cc-surface-hover);
}

.popup-option-item.selected {
    background: var(--scrim-soft);
}

.popup-option-item.selected span {
    color: var(--cc-primary-light);
}

.popup-option-item i {
    color: var(--cc-primary);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.popup-option-item.selected i {
    opacity: 1;
}

/* Error state for images */
.generated-image-item.error {
    background: var(--cc-surface);
    display: flex;
    align-items: center;
    justify-content: center;
}

.generated-image-item.error::after {
    content: '\\F622';
    font-family: 'bootstrap-icons';
    font-size: 2rem;
    color: var(--cc-text-muted);
}

.generated-image-item.error img {
    display: none;
}

/* Loading state for regeneration */
.generated-image-item.loading {
    background: var(--cc-surface);
    display: flex;
    align-items: center;
    justify-content: center;
}

.generated-image-item.loading .loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.generated-image-item.loading .spinner-border {
    color: var(--cc-primary);
    width: 2rem;
    height: 2rem;
}

/* Character Sheet Display (Step 6) */
.character-sheet-display {
    display: flex;
    gap: 16px;
    margin-top: 20px;
    align-items: flex-start;
    justify-content: center;
}

.char-sheet-item {
    flex: 1 1 0;
    max-width: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.char-sheet-placeholder {
    width: 100%;
    aspect-ratio: 2/3;
    background: var(--glass);
    border: 2px dashed rgba(0, 0, 0, 0.12);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-disabled);
    font-size: 2.5rem;
}

/* Loading state — while generation runs, the still-empty result slot
   shimmers and shows a spinner instead of its static placeholder icon.
   This replaces the old decorative progress panel. */
.char-sheet-placeholder.is-loading {
    position: relative;
    border-style: solid;
    border-color: var(--line);
    color: transparent;
    overflow: hidden;
    background: linear-gradient(
        100deg,
        rgba(0, 0, 0, 0.04) 30%,
        rgba(111, 111, 111, 0.14) 50%,
        rgba(0, 0, 0, 0.04) 70%
    );
    background-size: 200% 100%;
    animation: charSheetShimmer 1.4s ease-in-out infinite;
}

.char-sheet-placeholder.is-loading::after {
    content: "";
    position: absolute;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 3px solid rgba(0, 0, 0, 0.15);
    border-top-color: var(--line-strong);
    animation: spin 0.8s linear infinite;
}

@keyframes charSheetShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.char-sheet-img {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.char-sheet-img:hover {
    opacity: 0.88;
    transform: scale(1.02);
}

/* Landscape variant — the character sheet is a wide four-view collage, so it
   gets a 16:9 box and a wider column, while the close-up stays a portrait card. */
.char-sheet-item--landscape {
    max-width: 360px;
}
.char-sheet-placeholder--landscape,
.char-sheet-img--landscape {
    aspect-ratio: 16/9;
}

.char-sheet-label {
    font-size: 0.8rem;
    color: var(--cc-text-muted);
    text-align: center;
    margin: 0;
}

/* ── Lightbox ─────────────────────────────────────── */
.char-sheet-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--surface-page);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

.lightbox-img-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    overflow: hidden;
}

.lightbox-img-wrap img {
    width: auto;
    height: auto;
    max-width: 100vw;
    max-height: 100vh;
    object-fit: contain;
    border-radius: 0;
}

.lightbox-caption {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.85rem;
    color: var(--ink-soft);
    margin: 0;
    padding: 4px 12px;
    background: var(--veil);
    border-radius: 999px;
    pointer-events: none;
}

.lightbox-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: var(--glass-strong);
    border: none;
    color: var(--ink);
    font-size: 1.2rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s;
}
.lightbox-close:hover { background: var(--scrim-soft); }

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--glass-strong);
    border: none;
    color: var(--ink);
    font-size: 1.4rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s;
}
.lightbox-nav:hover { background: var(--scrim-soft); }
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }

.lightbox-dots {
    display: flex;
    gap: 8px;
}
.lightbox-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--scrim-soft);
    cursor: pointer;
    transition: background 0.15s;
}
.lightbox-dot.active {
    background: var(--brand-fill);
}

@media (max-width: 480px) {
    /* Keep the two cards side by side and centered (no vertical stacking) */
    .character-sheet-display {
        flex-direction: row;
        justify-content: center;
        align-items: flex-start;
        gap: 12px;
    }
    .char-sheet-item {
        flex: 1 1 0;
        max-width: 46%;
    }
    .char-sheet-item--landscape { flex: 1; }
    .char-sheet-placeholder--landscape,
    .char-sheet-img--landscape {
        aspect-ratio: 16/9;
    }
    .char-sheet-placeholder,
    .char-sheet-img {
        aspect-ratio: 2/3;
    }
}

/* ── Base face crop modal ───────────────────────────────────────────── */
.face-crop-modal {
    position: fixed;
    inset: 0;
    z-index: 10050;
    background: var(--veil-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.face-crop-dialog {
    width: min(460px, 96vw);
    background: var(--surface-sunken);
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 16px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.16);
}

.face-crop-header { text-align: center; }

.face-crop-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--ink);
}

.face-crop-hint {
    margin: 4px 0 0;
    font-size: 0.8rem;
    color: var(--ink-muted);
}

/* The stage sizes itself to the displayed image; the image is centered and
   scaled to fit, and the crop box is positioned in stage (image) coords. */
.face-crop-stage {
    position: relative;
    align-self: center;
    line-height: 0;
    touch-action: none;
    user-select: none;
    max-width: 100%;
}

.face-crop-stage img {
    display: block;
    max-width: 100%;
    max-height: 60vh;
    width: auto;
    height: auto;
    border-radius: 8px;
    pointer-events: none;
}

.face-crop-box {
    position: absolute;
    box-sizing: border-box;
    border: 2px solid var(--line-strong);
    border-radius: 4px;
    cursor: move;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.16);
}

.face-crop-handle {
    position: absolute;
    width: 22px;
    height: 22px;
    right: -11px;
    bottom: -11px;
    background: var(--brand-fill);
    border-radius: 50%;
    cursor: nwse-resize;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.16);
}

.face-crop-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn-crop-cancel,
.btn-crop-confirm {
    padding: 9px 18px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
}

.btn-crop-cancel {
    background: var(--glass-strong);
    color: var(--ink);
    border-color: var(--line);
}

.btn-crop-confirm {
    background: var(--fill-mid);
    color: var(--ink);
}

.btn-crop-confirm:hover { background: var(--fill-mid); }

/* =====================================================================
   Asset upload cards (Step 5) — character sheet / close-up / reference face
   Three mutually-exclusive upload paths; whatever is empty gets generated.
   ===================================================================== */
.asset-upload-section { margin-bottom: 24px; max-width: 100%; min-width: 0; }

/* Compact, horizontally-scrollable strip. Only THIS section scrolls sideways —
   it's width-bounded to its parent so it never widens the page. */
.asset-cards {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 2px 2px 10px;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
}
.asset-cards::-webkit-scrollbar { height: 8px; }
.asset-cards::-webkit-scrollbar-thumb { background: var(--cc-glass-border); border-radius: 4px; }

.asset-card {
    flex: 0 0 196px;
    max-width: 78vw;
    scroll-snap-align: start;
    background: var(--cc-glass-bg);
    border: 1px solid var(--cc-glass-border);
    border-radius: var(--cc-radius-md);
    padding: 12px;
    display: flex;
    flex-direction: column;
}
.asset-card.disabled { opacity: 0.6; }
.asset-card.locked { box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06); }

.asset-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}
.asset-card-title { font-weight: 700; font-size: 0.95rem; color: var(--cc-text, #000000); }
.asset-card-sub { font-size: 0.7rem; color: var(--cc-text-muted); margin-top: 2px; }

.asset-chip {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: var(--cc-radius-xl);
    white-space: nowrap;
    border: 1px solid var(--cc-glass-border);
    color: var(--cc-text-muted);
    background: var(--glass);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.asset-chip.uploaded { color: var(--cc-on-fill); background: var(--cc-primary); border-color: var(--cc-primary); }
.asset-chip.willgen { color: var(--ink-inverse); background: var(--cc-primary-light); border-color: var(--cc-primary-light); }
.asset-chip.generated { color: #06281f; background: var(--cc-success); border-color: var(--cc-success); }
.asset-chip.locked { color: #1c1606; background: #d79600; border-color: #d79600; }

.asset-dropzone {
    position: relative;
    aspect-ratio: 2 / 3;
    border: 2px dashed var(--cc-glass-border);
    border-radius: var(--cc-radius-md);
    background: var(--glass);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 14px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.25s ease;
}
.asset-dropzone:hover { background: var(--cc-surface-hover); border-color: var(--cc-primary-light); }
.asset-dropzone.drag-over {
    border-color: var(--cc-primary);
    background: var(--cc-surface-hover);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
}

.asset-dz-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--cc-text-muted);
    pointer-events: none;
}
.asset-dz-body i { font-size: 2.2rem; margin-bottom: 4px; opacity: 0.85; }
.asset-dz-text { font-size: 0.82rem; font-weight: 600; color: var(--cc-text, #000000); }
.asset-dz-hint { font-size: 0.68rem; }
.asset-dz-or { font-size: 0.64rem; opacity: 0.85; max-width: 150px; }

.asset-preview {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}
.asset-dropzone.has-image .asset-preview { display: block; }
.asset-dropzone.has-image .asset-dz-body { display: none; }

.asset-clear {
    position: absolute;
    right: 8px;
    top: 8px;
    z-index: 4;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: var(--veil-strong);
    color: var(--ink);
    display: none;
    align-items: center;
    justify-content: center;
}
.asset-dropzone.has-image .asset-clear { display: flex; }
.asset-dropzone.locked .asset-clear,
.asset-dropzone.disabled .asset-clear { display: none; }

/* disabled (the other path is in use) */
.asset-disabled-overlay,
.asset-lock-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px;
    text-align: center;
    backdrop-filter: blur(2px);
}
.asset-disabled-overlay { background: var(--veil-strong); }
.asset-disabled-overlay i { font-size: 1.6rem; color: var(--cc-text-muted); }
.asset-disabled-overlay span { font-size: 0.7rem; font-weight: 600; color: var(--cc-text-muted); }
.asset-dropzone.disabled { cursor: not-allowed; border-style: solid; border-color: var(--line); }
.asset-dropzone.disabled .asset-disabled-overlay { display: flex; }

/* locked while generating */
.asset-lock-overlay { background: var(--veil-strong); }
.asset-lock-overlay i { font-size: 1.6rem; color: #d79600; }
.asset-lock-overlay span { font-size: 0.68rem; font-weight: 600; color: #d3ac45; }
.asset-dropzone.locked { cursor: not-allowed; pointer-events: none; border-style: solid; border-color: rgba(215, 150, 0, 0.4); }
.asset-dropzone.locked .asset-lock-overlay { display: flex; }
.btn-crop-cancel:hover { background: var(--scrim-soft); }

/* ============================================================
   Clone-from-photo hero (Step 1) — take a selfie / upload a
   photo → Grok vision pre-fills the whole wizard.
   ============================================================ */
/* White card on a hairline black border. The former grey gradient fill and the
   blurred radial "glow" corner are both dropped — .cc-clone-hero-glow is left in
   the markup but rendered to nothing so the hero is flat. */
.cc-clone-hero {
    position: relative;
    margin: 0 0 28px;
    padding: 22px 22px 20px;
    border-radius: var(--cc-radius-lg);
    background: #ffffff;
    border: 1px solid #000000;
    overflow: hidden;
}
.cc-clone-hero-glow { display: none; }
.cc-clone-hero-body { position: relative; z-index: 1; }
.cc-clone-badge {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
    color: #ffffff;
    background: #000000;
    padding: 5px 11px; border-radius: 999px;
}
.cc-clone-title {
    font-size: 1.35rem; font-weight: 800; margin: 12px 0 4px; color: var(--cc-text);
    line-height: 1.2;
}
.cc-clone-sub {
    font-size: 0.9rem; color: var(--cc-text-secondary); margin: 0 0 16px; max-width: 46ch;
}
.cc-clone-actions { display: flex; flex-wrap: wrap; gap: 12px; }
/* Take a selfie (filled black) / Upload a photo (outlined black). Both invert
   on hover — no grey, no gradient, no lift transform. */
.cc-clone-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    flex: 1 1 180px;
    padding: 13px 18px; border-radius: var(--cc-radius-xl);
    font-size: 0.95rem; font-weight: 700; cursor: pointer;
    border: 1.5px solid #000000;
    transition: background .18s ease, color .18s ease, opacity .18s ease;
}
.cc-clone-btn i { font-size: 1.15rem; }
.cc-clone-btn--selfie { color: #ffffff; background: #000000; }
.cc-clone-btn--selfie:hover:not(:disabled) { background: #ffffff; color: #000000; }
.cc-clone-btn--upload { color: #000000; background: #ffffff; }
.cc-clone-btn--upload:hover:not(:disabled) { background: #000000; color: #ffffff; }
.cc-clone-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* Status row + preview */
.cc-clone-status {
    display: flex; align-items: center; gap: 14px;
    margin-top: 16px; padding: 12px;
    background: var(--cc-surface); border: 1px solid var(--cc-border);
    border-radius: var(--cc-radius-md);
}
.cc-clone-thumb {
    width: 52px; height: 52px; border-radius: 10px; object-fit: cover; flex: 0 0 auto;
    object-position: center top;
    border: 1px solid var(--cc-border); background: var(--cc-bg-secondary);
}
.cc-clone-status-main { flex: 1 1 auto; min-width: 0; }
.cc-clone-status-line { display: block; font-size: 0.88rem; font-weight: 600; color: var(--cc-text); margin-bottom: 7px; }
.cc-clone-status-bar { height: 4px; border-radius: 999px; background: var(--glass-strong); overflow: hidden; }
.cc-clone-status-bar > span {
    display: block; height: 100%; width: 40%; border-radius: 999px;
    background: var(--cc-gradient);
    animation: ccCloneSlide 1.1s ease-in-out infinite;
}
.cc-clone-status.done .cc-clone-status-bar > span { width: 100%; animation: none; }
.cc-clone-status.error .cc-clone-status-line { color: var(--cc-error); }
@keyframes ccCloneSlide {
    0% { margin-left: -40%; } 100% { margin-left: 100%; }
}
.cc-clone-redo {
    flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%;
    border: 1px solid var(--cc-border); background: var(--cc-surface); color: var(--cc-text-secondary);
    cursor: pointer; transition: background .15s ease, color .15s ease;
}
.cc-clone-redo:hover { background: var(--cc-surface-hover); color: var(--cc-text); }

/* Details (description + real size) */
.cc-clone-details { margin-top: 16px; display: grid; gap: 12px; }
.cc-clone-field { display: flex; flex-direction: column; gap: 6px; }
.cc-clone-field label { font-size: 0.85rem; font-weight: 600; color: var(--cc-text); }
.cc-clone-field .cc-opt { color: var(--cc-text-muted); font-weight: 400; }
.cc-clone-field textarea,
.cc-clone-field input[type="text"] {
    width: 100%; padding: 10px 12px;
    background: var(--cc-bg-secondary); color: var(--cc-text);
    border: 1px solid var(--cc-border); border-radius: var(--cc-radius-sm);
    font-size: 0.9rem; resize: vertical;
}
.cc-clone-field textarea:focus,
.cc-clone-field input[type="text"]:focus {
    outline: none; border-color: var(--cc-primary); box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.06);
}
.cc-clone-realperson {
    margin: 2px 0 0; font-size: 0.82rem; color: var(--cc-text-secondary);
    display: flex; align-items: center; gap: 6px;
}
.cc-clone-realperson.is-real { color: var(--cc-primary-light); }

@media (max-width: 520px) {
    .cc-clone-title { font-size: 1.15rem; }
    .cc-clone-actions { flex-direction: column; }
    .cc-clone-btn { flex: 1 1 auto; }
}

/* ============================================================================
   PHOTO-FIRST ENTRY  (/create-character only — `photoFirstEntry` in the view)

   The page opens on ONE upload zone. `.cc-entry-mode` on the wrapper hides the
   six-step wizard and its footer entirely; "create from scratch" removes the
   class and the ordinary wizard takes over from step 1.

   Same flat monochrome language as the rest of this file: white surfaces,
   hairline borders, black fills, no glass and no gradient.
   ========================================================================== */

/* Wizard hidden while the entry hero owns the screen. `display: none` rather
   than visibility so the hidden slides cannot claim layout height — the entry
   is vertically centred and a 6-slide-tall ghost below it would break that. */
.character-creation-wrapper.cc-entry-mode .steps-wrapper,
.character-creation-wrapper.cc-entry-mode .character-creation-footer,
.character-creation-wrapper.cc-entry-mode .progress-container {
    display: none !important;
}

/* Once the visitor picks "create from scratch" the hero is gone for good. */
.character-creation-wrapper:not(.cc-entry-mode) .cc-entry {
    display: none;
}

.cc-entry {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 32px 0 48px;
    animation: ccEntryIn 0.5s ease both;
}

@keyframes ccEntryIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}

/* ── 1 · The ask ─────────────────────────────────────────────────────────── */

.cc-entry-upload { text-align: center; }

.cc-entry-title {
    font-size: 2rem;
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--cc-text);
    margin: 0 0 10px;
}

.cc-entry-sub {
    font-size: 0.98rem;
    line-height: 1.5;
    color: var(--cc-text-muted);
    margin: 0 auto 26px;
    max-width: 26em;
}

/* The zone itself. Deliberately big — it is the only call to action on the
   page, so it gets the whole width and a tall aspect. */
.cc-entry-drop {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 264px;
    padding: 32px 24px;
    border: 2px dashed var(--cc-border);
    border-radius: var(--cc-radius-lg);
    background: var(--cc-surface);
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.cc-entry-drop:hover,
.cc-entry-drop:focus-visible,
.cc-entry-drop.is-dragover {
    border-color: var(--cc-text);
    background: var(--cc-surface-hover);
    outline: none;
}

.cc-entry-drop.is-dragover { transform: scale(1.01); }

/* A slow sweep across the zone so it reads as live rather than as an empty box. */
.cc-entry-drop-glow {
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 35%, rgba(0, 0, 0, 0.035) 50%, transparent 65%);
    animation: ccEntrySweep 3.6s linear infinite;
    pointer-events: none;
}

@keyframes ccEntrySweep {
    from { transform: translateX(-60%); }
    to   { transform: translateX(60%); }
}

.cc-entry-drop-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.cc-entry-drop-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 62px;
    height: 62px;
    border-radius: var(--cc-radius-full);
    background: var(--cc-primary);
    color: var(--cc-on-fill);
    font-size: 1.6rem;
    margin-bottom: 4px;
}

.cc-entry-drop-main {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--cc-text);
}

.cc-entry-drop-hint {
    font-size: 0.85rem;
    color: var(--cc-text-muted);
    max-width: 22em;
}

/* The escape hatch. Small and secondary on purpose — the photo is the pitch. */
.cc-entry-scratch {
    display: inline-block;
    margin-top: 18px;
    padding: 8px 4px;
    border: none;
    background: transparent;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--cc-text-muted);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    transition: color 0.15s ease;
}

.cc-entry-scratch:hover { color: var(--cc-text); }

/* ── 2 · The build ───────────────────────────────────────────────────────── */

.cc-entry-stage { animation: ccEntryIn 0.4s ease both; }

.cc-stage-head {
    text-align: center;
    margin-bottom: 26px;
}

/* The photo the visitor gave us, scanning. Hidden once the result lands
   (`.cc-entry-stage.is-done`) — at that point the render is the subject. */
.cc-stage-orb {
    position: relative;
    width: 116px;
    height: 116px;
    margin: 0 auto 18px;
    border-radius: var(--cc-radius-full);
    overflow: hidden;
    background: var(--cc-bg-secondary);
}

.cc-stage-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Crop from the top, not the middle. These are phone photos of people —
       a portrait frame centred on 50% cuts the head off and shows a chest. */
    object-position: center top;
    display: block;
    filter: grayscale(0.15) contrast(1.03);
}

.cc-stage-ring {
    position: absolute;
    inset: 0;
    border-radius: var(--cc-radius-full);
    border: 2px solid var(--cc-border);
    border-top-color: var(--cc-text);
    animation: ccStageSpin 1.1s linear infinite;
}

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

/* A scan line travelling down the face — the "we are reading it" cue. */
.cc-stage-scan {
    position: absolute;
    left: 0;
    right: 0;
    height: 34%;
    top: -34%;
    background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.16), transparent);
    animation: ccStageScan 1.9s ease-in-out infinite;
}

@keyframes ccStageScan {
    0%   { top: -34%; }
    100% { top: 100%; }
}

.cc-entry-stage.is-done .cc-stage-ring,
.cc-entry-stage.is-done .cc-stage-scan { display: none; }

.cc-entry-stage.is-done .cc-stage-orb { display: none; }

.cc-stage-title {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--cc-text);
    margin: 0 0 8px;
}

.cc-stage-line {
    font-size: 0.92rem;
    color: var(--cc-text-muted);
    margin: 0 0 16px;
    min-height: 1.4em;
}

.cc-stage-bar {
    height: 4px;
    border-radius: 999px;
    background: var(--cc-bg-secondary);
    overflow: hidden;
    max-width: 340px;
    margin: 0 auto 18px;
}

.cc-stage-bar > span {
    display: block;
    height: 100%;
    width: 4%;
    border-radius: 999px;
    background: var(--cc-primary);
    transition: width 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.cc-entry-stage.is-done .cc-stage-bar { display: none; }

/* The named phases, so the wait reads as progress and not as a hang. */
.cc-stage-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: inline-flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}

.cc-stage-steps li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.88rem;
    color: var(--cc-text-muted);
    opacity: 0.45;
    transition: opacity 0.3s ease, color 0.3s ease;
}

.cc-stage-steps li .cc-stage-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    border-radius: var(--cc-radius-full);
    border: 1.5px solid currentColor;
    font-size: 0.66rem;
}

.cc-stage-steps li.is-active {
    opacity: 1;
    color: var(--cc-text);
    font-weight: 600;
}

.cc-stage-steps li.is-done {
    opacity: 1;
    color: var(--cc-text);
}

.cc-stage-steps li.is-done .cc-stage-dot {
    background: var(--cc-primary);
    color: var(--cc-on-fill);
    border-color: var(--cc-primary);
}

.cc-entry-stage.is-done .cc-stage-steps { display: none; }

/* ── Feature carousel — the wait as a showcase ───────────────────────────────
   One platform capability at a time (title + one-line subtitle), rotating ≈5s
   under the phase list while the build runs, with a static coins note under
   the dots. Filled by _startFeatureCarousel(); decorative only, so the phase
   list and bar above keep sole custody of "what is happening". */

.cc-stage-feature {
    max-width: 340px;
    margin: 22px auto 0;
}

.cc-entry-stage.is-done .cc-stage-feature { display: none; }

.cc-stage-feature-kicker {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--cc-text-muted);
    margin: 0 0 10px;
}

.cc-stage-feature-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-radius-lg);
    background: var(--cc-surface);
    /* Two lines of text now live here — a fixed min-height keeps the card from
       jumping when a short label follows a long one. */
    min-height: 68px;
    text-align: left;
}

.cc-stage-feature-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.cc-stage-feature-card.is-in {
    animation: ccFeatureIn 0.45s ease both;
}

@keyframes ccFeatureIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}

.cc-stage-feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: var(--cc-radius-full);
    background: var(--cc-primary);
    color: var(--cc-on-fill);
    font-size: 1.05rem;
    animation: ccFeaturePulse 2.2s ease-in-out infinite;
}

@keyframes ccFeaturePulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.08); }
}

.cc-stage-feature-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--cc-text);
    text-align: left;
}

.cc-stage-feature-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
}

.cc-stage-feature-dot {
    width: 6px;
    height: 6px;
    border-radius: var(--cc-radius-full);
    background: var(--cc-border);
    transition: background 0.3s ease, transform 0.3s ease;
}

.cc-stage-feature-dot.is-active {
    background: var(--cc-primary);
    transform: scale(1.25);
}

.cc-stage-feature-sub {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--cc-text-muted);
    line-height: 1.35;
}

/* The conversion nudge: photos cost coins, daily logins earn free ones. */
.cc-stage-feature-coins {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 6px;
    margin: 12px auto 0;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--cc-text-muted);
    text-align: left;
    max-width: 320px;
}

.cc-stage-feature-coins .bi-coin {
    color: var(--cc-primary);
    font-size: 0.9rem;
    line-height: 1.2;
    flex: 0 0 auto;
}

/* The portrait a logged-out visitor does not get yet. Reads as a locked step
   under the phase list, deliberately quieter than a running phase — it is a
   statement of what happens next, not work in progress. */
.cc-stage-pending {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 10px auto 0;
    padding: 8px 14px;
    max-width: 340px;
    border: 1px dashed var(--cc-border);
    border-radius: var(--cc-radius-xl);
    background: var(--cc-bg-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--cc-text-muted);
}

.cc-stage-pending .bi-lock-fill {
    font-size: 0.85rem;
    color: var(--cc-primary);
    flex: 0 0 auto;
}

/* Result slots waiting on an account: no shimmer (nothing is running), just the
   lock and one line. */
.char-sheet-placeholder.is-pending-signup {
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border-style: dashed;
    text-align: center;
}

.char-sheet-placeholder.is-pending-signup .char-sheet-pending-note {
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--cc-text-muted);
    max-width: 15ch;
}

/* Whose face is in the avatar, and when the real one arrives. */
.cc-chat-placeholder-note {
    margin: 0;
    padding: 8px 16px;
    border-bottom: 1px solid var(--cc-border);
    background: var(--cc-bg-secondary);
    font-size: 0.74rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--cc-text-muted);
    text-align: left;
}

.cc-stage-result { margin-bottom: 18px; }

.cc-stage-actions { margin-bottom: 18px; }

.cc-stage-retry {
    display: block;
    margin: 4px auto 0;
    padding: 10px 18px;
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-radius-xl);
    background: var(--cc-surface);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--cc-text);
    cursor: pointer;
}

.cc-stage-retry:hover { background: var(--cc-surface-hover); }

/* ── Locked chat preview — the conversation, already waiting ─────────────────
   Sits between the generated images and the sign-up card for a guest: a real
   chat header + the character's generated first message as an incoming bubble,
   over an input that is visibly there but locked. Entirely static — the
   "input" is a div and the send button is disabled — so it can promise the
   chat without being able to start one. */

.cc-chat-preview {
    margin: 4px 0 18px;
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-radius-lg);
    background: var(--cc-surface);
    overflow: hidden;
    animation: ccUnlockIn 0.45s ease both;
}

.cc-chat-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--cc-border);
}

.cc-chat-avatar {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: var(--cc-radius-full);
    object-fit: cover;
    /* Faces sit at the top of a portrait frame — same reason as .cc-stage-photo,
       and the same choice the chat page's identity avatar already makes. */
    object-position: center top;
    background: var(--cc-bg-secondary);
}

.cc-chat-head-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: left;
    min-width: 0;
}

.cc-chat-name {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--cc-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cc-chat-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    color: var(--cc-text-muted);
}

.cc-chat-status-dot {
    width: 7px;
    height: 7px;
    border-radius: var(--cc-radius-full);
    background: #2ecc71;
}

.cc-chat-body {
    padding: 16px;
    text-align: left;
}

.cc-chat-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.cc-chat-bubble-avatar {
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    border-radius: var(--cc-radius-full);
    object-fit: cover;
    object-position: center top;
    background: var(--cc-bg-secondary);
}

.cc-chat-bubble {
    max-width: 85%;
    padding: 10px 14px;
    border: 1px solid var(--cc-border);
    border-radius: 16px 16px 16px 4px;
    background: var(--cc-bg-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--cc-text);
    animation: ccUnlockIn 0.45s ease 0.15s both;
}

.cc-chat-bubble em {
    color: var(--cc-text-muted);
    font-style: italic;
}

/* The locked input. Present so the chat reads as one keystroke away, but a
   plain div — nothing to focus, type into, or submit. */
.cc-chat-input {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--cc-border);
}

.cc-chat-input-field {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 8px 14px;
    border: 1px dashed var(--cc-border);
    border-radius: var(--cc-radius-xl);
    background: var(--cc-bg-secondary);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--cc-text-muted);
    user-select: none;
}

.cc-chat-send {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-radius-full);
    background: var(--cc-bg-secondary);
    color: var(--cc-text-muted);
    font-size: 0.95rem;
    opacity: 0.55;
    cursor: not-allowed;
}

/* ── 3 · The gate ────────────────────────────────────────────────────────── */

/* What sits behind the gate. Blurred and inert — the result above it stays
   perfectly sharp, because seeing the character is the whole hook; it is only
   what you can DO next that is held back. */
.cc-locked {
    filter: blur(5px);
    opacity: 0.55;
    pointer-events: none;
    user-select: none;
}

.cc-unlock {
    margin: 4px 0 28px;
    animation: ccUnlockIn 0.45s ease both;
}

@keyframes ccUnlockIn {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}

.cc-unlock-card {
    border: 1px solid var(--cc-text);
    border-radius: var(--cc-radius-lg);
    background: var(--cc-surface);
    padding: 24px 22px;
    text-align: center;
}

.cc-unlock-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: var(--cc-radius-xl);
    background: var(--cc-primary);
    color: var(--cc-on-fill);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    margin-bottom: 12px;
}

.cc-unlock-title {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--cc-text);
    margin: 0 0 8px;
}

.cc-unlock-text {
    font-size: 0.92rem;
    line-height: 1.5;
    color: var(--cc-text-muted);
    margin: 0 auto 16px;
    max-width: 30em;
}

.cc-unlock-perks {
    list-style: none;
    margin: 0 auto 20px;
    padding: 0;
    display: inline-flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}

.cc-unlock-perks li {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 0.9rem;
    color: var(--cc-text);
}

.cc-unlock-perks i { color: var(--cc-text); }

.cc-unlock-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    padding: 15px 22px;
    border: 1px solid var(--cc-primary);
    border-radius: var(--cc-radius-xl);
    background: var(--cc-primary);
    color: var(--cc-on-fill);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.cc-unlock-btn:hover:not(:disabled) {
    background: var(--cc-surface);
    color: var(--cc-text);
}

.cc-unlock-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.cc-unlock-fine {
    font-size: 0.78rem;
    color: var(--cc-text-muted);
    margin: 12px 0 0;
}

/* ── Post-sign-in handover ───────────────────────────────────────────────── */

.cc-claim-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cc-bg);
    padding: 24px;
}

.cc-claim-box { text-align: center; max-width: 24em; }

.cc-claim-spinner {
    width: 42px;
    height: 42px;
    margin: 0 auto 18px;
    border-radius: var(--cc-radius-full);
    border: 3px solid var(--cc-border);
    border-top-color: var(--cc-text);
    animation: ccStageSpin 0.9s linear infinite;
}

.cc-claim-line {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--cc-text);
    margin: 0 0 6px;
}

.cc-claim-sub {
    font-size: 0.9rem;
    color: var(--cc-text-muted);
    margin: 0;
}

.cc-claim-fallback {
    display: inline-block;
    margin-top: 18px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--cc-text);
    text-decoration: underline;
    text-underline-offset: 3px;
}

@media (max-width: 480px) {
    .cc-entry-title { font-size: 1.6rem; }
    .cc-entry-drop { min-height: 220px; }
    .cc-entry-drop-icon { width: 54px; height: 54px; font-size: 1.4rem; }
    .cc-unlock-card { padding: 20px 16px; }
    .cc-unlock-title { font-size: 1.15rem; }
    .cc-chat-bubble { max-width: 100%; }
}

/* Motion is decorative here — the phase list and the progress bar still say
   what is happening without any of it. */
@media (prefers-reduced-motion: reduce) {
    .cc-entry-drop-glow,
    .cc-stage-ring,
    .cc-stage-scan,
    .cc-stage-feature-icon,
    .cc-claim-spinner { animation: none; }
    .cc-entry,
    .cc-entry-stage,
    .cc-stage-feature-card.is-in,
    .cc-chat-preview,
    .cc-chat-bubble,
    .cc-unlock { animation: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   CHATLAMIX SKIN — html[data-brand="chatlamix"]
   The companion brand's Aurora Glass palette (violet #8240ff, page #0a0810 —
   see the chatlamix block in theme.css, which re-values the GLOBAL tokens the
   same way). A view opts in by stamping data-brand="{{brand.id}}" on <html>;
   today that is character-creation-page.hbs, so /create-character and
   /chat/edit wear the dark wizard on chatlamix.com and stay monochrome on
   every other host. The --cc-* re-values below flip the whole wizard (the
   file's every rule reads them); the overrides that follow fix the places
   where the monochrome pass hardcoded a literal.
   Keep this block LAST: it must win over every rule above it.
   ═══════════════════════════════════════════════════════════════════════════ */
html[data-brand="chatlamix"] {
    --cc-bg: #0a0810;
    --cc-bg-secondary: #1c1926;
    --cc-surface: #14101f;
    --cc-surface-hover: #1c1926;
    --cc-border: rgba(255, 255, 255, 0.14);

    --cc-primary: #8240ff;
    --cc-primary-light: #d2b8ff;
    --cc-primary-dark: #6e20f4;

    --cc-text: #f4f1fa;
    --cc-text-secondary: #c9c4d6;
    --cc-text-muted: #8d8898;
    --cc-on-fill: #ffffff;

    --cc-success: #3ecf7a;
    --cc-error: #ff6262;
    --cc-warning: #ffc94d;
    --cc-info: #c9c4d6;
    --cc-model-bg: #1c1926;

    /* The brand gradient — same ramp as the landing / sign-up pages. Call
       sites that clip it into text keep working. */
    --cc-gradient: linear-gradient(105deg, #d2b8ff 0%, #8240ff 54%, #1fc7ff 120%);
    --cc-gradient-hover: linear-gradient(105deg, #f0e6ff 0%, #9e5cff 48%, #4ed7ff 118%);

    --cc-glass-bg: rgba(20, 16, 31, 0.62);
    --cc-glass-border: rgba(255, 255, 255, 0.12);
    --cc-blur: 0px;

    --cc-shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.55);
}

/* ── Page chrome ──────────────────────────────────────────────────────────
   Both of these are hardcoded #ffffff in the monochrome rules above. The
   body also carries the clx-create wall (character-creation-page.hbs) at
   z-index:-1 above them, covering the first frame. */
html[data-brand="chatlamix"] body.character-creation-page-body { background: #0a0810; }
html[data-brand="chatlamix"] .character-creation-bg { background: #0a0810; }
/* The wizard wrapper paints its own OPAQUE --cc-bg sheet and is positioned
   (relative), so it would cover the wall behind it — on this skin the page
   ground is the body/canvas and the wall shows through the transparent
   wrapper. Below the wall (first frame) the ground is solid #0a0810. */
html[data-brand="chatlamix"] .character-creation-wrapper { background-color: transparent; }

/* ── Wizard image cards — the label scrims were white washes over the photo
   tiles. Flip them to the dark family so the labels read on this page. The
   .selected variants already use a near-black scrim + white text and carry
   over unchanged. ──────────────────────────────────────────────────────── */
html[data-brand="chatlamix"] .style-card .style-card-label,
html[data-brand="chatlamix"] .ethnicity-card span,
html[data-brand="chatlamix"] .hair-style-card span,
html[data-brand="chatlamix"] .hair-color-card span,
html[data-brand="chatlamix"] .body-type-card span,
html[data-brand="chatlamix"] .breast-size-card span,
html[data-brand="chatlamix"] .butt-size-card span,
html[data-brand="chatlamix"] .build-card span {
    background: linear-gradient(0deg, rgba(10, 8, 16, 0.88) 0%, rgba(10, 8, 16, 0.45) 60%, transparent 100%);
    color: #ffffff;
}

/* Model selection panel + style tiles: near-black hairlines are invisible on
   the dark ground — restate them in the white-line family. */
html[data-brand="chatlamix"] .model-selection-section { border-color: rgba(255, 255, 255, 0.12); }
html[data-brand="chatlamix"] .model-style-item .style-option { border-color: rgba(255, 255, 255, 0.18); }

/* ── Clone-hero buttons: filled black / outlined black become gradient /
   dark glass, matching the entry CTA language of the brand pages. ───────── */
html[data-brand="chatlamix"] .cc-clone-btn { border-color: rgba(255, 255, 255, 0.22); }
html[data-brand="chatlamix"] .cc-clone-btn--selfie { color: #ffffff; background: var(--cc-gradient); border-color: transparent; }
html[data-brand="chatlamix"] .cc-clone-btn--selfie:hover:not(:disabled) { background: var(--cc-gradient-hover); color: #ffffff; }
html[data-brand="chatlamix"] .cc-clone-btn--upload { color: var(--cc-text); background: rgba(255, 255, 255, 0.06); }
html[data-brand="chatlamix"] .cc-clone-btn--upload:hover:not(:disabled) { background: rgba(255, 255, 255, 0.12); color: #ffffff; }
/* The clone field focus ring was a black 6% glow. */
html[data-brand="chatlamix"] .cc-clone-field textarea:focus,
html[data-brand="chatlamix"] .cc-clone-field input[type="text"]:focus {
    box-shadow: 0 0 0 2px rgba(130, 64, 255, 0.35);
}

/* The entry drop's live sweep was a 3.5% black shine — invisible on dark. */
html[data-brand="chatlamix"] .cc-entry-drop-glow {
    background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.07) 50%, transparent 65%);
}

/* ── Footer nav bar (Back · indicator · Next) — hardcoded white sheet. ───── */
html[data-brand="chatlamix"] .character-creation-footer {
    background: rgba(16, 12, 26, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top-color: rgba(255, 255, 255, 0.12);
}
/* Back — white with black outline becomes outlined on the dark bar. */
html[data-brand="chatlamix"] .character-creation-wrapper .btn-back {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.32);
    color: var(--cc-text);
}
html[data-brand="chatlamix"] .character-creation-wrapper .btn-back:hover {
    background: rgba(255, 255, 255, 0.10);
    border-color: rgba(255, 255, 255, 0.55);
    color: #ffffff;
}
html[data-brand="chatlamix"] .character-creation-wrapper .btn-back:disabled,
html[data-brand="chatlamix"] .character-creation-wrapper .btn-back:disabled:hover {
    background: transparent;
    color: var(--cc-text);
}
/* Next — solid black becomes the brand gradient. */
html[data-brand="chatlamix"] .character-creation-wrapper .btn-next {
    background: var(--cc-gradient);
    border-color: transparent;
    color: #ffffff;
}
html[data-brand="chatlamix"] .character-creation-wrapper .btn-next:hover:not(:disabled) {
    background: var(--cc-gradient-hover);
    color: #ffffff;
}
html[data-brand="chatlamix"] .character-creation-wrapper .btn-next:disabled {
    background: rgba(255, 255, 255, 0.08);
    color: var(--cc-text-muted);
}
/* Step counter + progress dots: black ink / black fills become white / violet. */
html[data-brand="chatlamix"] .cc-step-count { color: var(--cc-text); }
html[data-brand="chatlamix"] .cc-step-dot { background: transparent; border-color: rgba(255, 255, 255, 0.35); }
html[data-brand="chatlamix"] .cc-step-dot.done,
html[data-brand="chatlamix"] .cc-step-dot.is-current { background: #8240ff; border-color: #8240ff; }

/* ── Character-sheet placeholders (step 6): dark hairlines / dark shimmer
   re-lit for the dark ground. ────────────────────────────────────────────── */
html[data-brand="chatlamix"] .char-sheet-placeholder { border-color: rgba(255, 255, 255, 0.22); }
html[data-brand="chatlamix"] .char-sheet-placeholder.is-loading {
    background: linear-gradient(
        100deg,
        rgba(255, 255, 255, 0.04) 30%,
        rgba(255, 255, 255, 0.10) 50%,
        rgba(255, 255, 255, 0.04) 70%
    );
    background-size: 200% 100%;
}
html[data-brand="chatlamix"] .char-sheet-placeholder.is-loading::after {
    border-color: rgba(255, 255, 255, 0.18);
    border-top-color: #d2b8ff;
}
html[data-brand="chatlamix"] .char-sheet-img { border-color: rgba(255, 255, 255, 0.10); }

/* Face-crop dialog sits on var(--surface-sunken) (dark via theme.css); its
   near-black hairline needs the white family too. */
html[data-brand="chatlamix"] .face-crop-dialog { border-color: rgba(255, 255, 255, 0.12); }

/* Error toast: the skin lightens --cc-error, so the label flips to the dark
   status-ink (same choice as --status-ink in theme.css). */
html[data-brand="chatlamix"] .error-toast { color: #0a0810; }

/* Unlock CTA hover: the base hover (surface bg + text) is a no-op dark-on-dark
   here — invert to a white plate, the monochrome rule's own inversion trick. */
html[data-brand="chatlamix"] .cc-unlock-btn:hover:not(:disabled) {
    background: #ffffff;
    color: #0a0810;
}
