/* ── Reset & Base ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg-deep: #111118;
    --bg-surface: #1a1a2e;
    --bg-card: #22223a;
    --bg-card-hover: #2a2a48;
    --bg-input: #16162a;
    --border: #2e2e4a;
    --border-focus: #00d4aa;

    --teal: #00d4aa;
    --teal-dim: rgba(0, 212, 170, 0.15);
    --teal-glow: rgba(0, 212, 170, 0.25);
    --amber: #f0a500;
    --amber-dim: rgba(240, 165, 0, 0.15);
    --red: #ff4d6a;
    --red-dim: rgba(255, 77, 106, 0.15);
    --green: #34d399;

    --text-primary: #e8e8f0;
    --text-secondary: #9898b0;
    --text-muted: #686888;
    --text-inverse: #111118;

    --font: 'Satoshi', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;

    --max-width: 1200px;
    --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body {
    font-family: var(--font);
    background: var(--bg-deep);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.hidden { display: none !important; }

/* ── Scrollbar ─────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* ── App Container ─────────────────────────────────────────────── */
.app { min-height: 100vh; display: flex; flex-direction: column; }

/* ── Header ────────────────────────────────────────────────────── */
.header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(17, 17, 24, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
}
.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    height: 56px;
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon { width: 32px; height: 32px; }
.logo-text { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; color: var(--text-primary); }
.session-id { display: flex; align-items: center; gap: 8px; }
.session-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.session-value {
    font-size: 12px; font-weight: 500; color: var(--teal);
    background: var(--teal-dim); padding: 2px 8px; border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
}

/* ── Phase Stepper ─────────────────────────────────────────────── */
.stepper {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    overflow-x: auto;
}
.stepper-inner {
    max-width: var(--max-width); margin: 0 auto;
    display: flex; align-items: center; gap: 0;
    justify-content: center;
}
.step {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    cursor: default;
    transition: var(--transition);
    white-space: nowrap;
}
.step-num {
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 13px; font-weight: 700;
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1.5px solid var(--border);
    transition: var(--transition);
}
.step-label { font-size: 13px; font-weight: 500; color: var(--text-secondary); transition: var(--transition); }
.step-line { width: 24px; height: 1px; background: var(--border); flex-shrink: 0; }

.step.active .step-num { background: var(--teal); color: var(--text-inverse); border-color: var(--teal); }
.step.active .step-label { color: var(--teal); }
.step.completed .step-num { background: var(--teal-dim); color: var(--teal); border-color: var(--teal); }
.step.completed .step-label { color: var(--text-primary); }

/* ── Main Content ──────────────────────────────────────────────── */
.main {
    flex: 1; max-width: var(--max-width);
    margin: 0 auto; width: 100%;
    padding: 32px 24px 64px;
}

/* ── Phase Headers ─────────────────────────────────────────────── */
.phase-header { text-align: center; margin-bottom: 40px; }
.phase-title {
    font-size: clamp(24px, 4vw, 36px);
    font-weight: 900; letter-spacing: -0.03em;
    color: var(--text-primary);
    margin-bottom: 8px;
}
.phase-subtitle { font-size: 16px; color: var(--text-secondary); max-width: 500px; margin: 0 auto; }

/* ── Type Selection Cards ──────────────────────────────────────── */
.type-grid, .level-grid {
    display: grid; gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    max-width: 900px; margin: 0 auto;
}
.type-card, .level-card {
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    cursor: pointer;
    text-align: left;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.type-card::before, .level-card::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, var(--teal-dim), transparent);
    opacity: 0; transition: var(--transition);
}
.type-card:hover, .level-card:hover {
    border-color: var(--teal);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 212, 170, 0.08);
}
.type-card:hover::before, .level-card:hover::before { opacity: 1; }
.type-card.selected, .level-card.selected {
    border-color: var(--teal);
    background: rgba(0, 212, 170, 0.06);
}

.type-icon, .level-icon {
    width: 40px; height: 40px; margin-bottom: 16px;
    color: var(--teal);
}
.type-icon svg, .level-icon svg { width: 100%; height: 100%; }
.type-card h3, .level-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 6px; position: relative; color: #ffffff; }
.type-card p, .level-card p { font-size: 13px; color: #c0c0d0; line-height: 1.5; position: relative; }

/* ── Upload Zone ──────────────────────────────────────────────── */
.upload-zone-container { max-width: 720px; margin: 0 auto; }

.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 48px 32px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    background: var(--bg-card);
}
.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--teal);
    background: rgba(0, 212, 170, 0.04);
}
.upload-zone.drag-over {
    border-style: solid;
    box-shadow: 0 0 24px var(--teal-dim);
}
.upload-icon { width: 48px; height: 48px; margin: 0 auto 16px; }
.upload-text { font-size: 16px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.upload-hint { font-size: 14px; color: var(--teal); margin-bottom: 8px; }
.upload-formats { font-size: 12px; color: var(--text-muted); }

/* ── Uploaded File Cards ──────────────────────────────────────── */
.uploaded-files {
    display: flex; flex-direction: column; gap: 8px;
    margin-top: 16px;
}
.file-card {
    display: flex; align-items: center; gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    animation: slideIn 0.2s ease;
}
@keyframes slideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
.file-card-icon {
    width: 36px; height: 36px;
    background: var(--teal-dim);
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.file-card-icon svg { width: 18px; height: 18px; color: var(--teal); }
.file-card-info { flex: 1; min-width: 0; }
.file-card-name {
    font-size: 14px; font-weight: 600; color: var(--text-primary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.file-card-size { font-size: 12px; color: var(--text-muted); }
.file-card-remove {
    background: none; border: none;
    color: var(--text-muted); cursor: pointer;
    padding: 4px; transition: var(--transition);
    display: flex; align-items: center; justify-content: center;
    border-radius: 4px;
}
.file-card-remove:hover { color: var(--red); background: var(--red-dim); }

/* ── Notes Section ────────────────────────────────────────────── */
.notes-section { margin-top: 24px; }
.notes-label {
    display: block; font-size: 13px; font-weight: 600;
    color: var(--text-secondary); margin-bottom: 8px;
}
.notes-section textarea {
    width: 100%;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 14px;
    resize: vertical;
    min-height: 80px;
    transition: var(--transition);
}
.notes-section textarea:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px var(--teal-dim);
}
.notes-section textarea::placeholder { color: var(--text-muted); }

/* ── Form Actions ─────────────────────────────────────────────── */
.form-actions {
    display: flex; gap: 12px; justify-content: space-between;
    align-items: center; padding-top: 24px;
}

/* ── Buttons ───────────────────────────────────────────────────── */
.btn-primary {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--teal);
    color: var(--text-inverse);
    border: none; border-radius: var(--radius-sm);
    padding: 12px 24px;
    font-family: var(--font);
    font-size: 14px; font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    min-height: 44px;
}
.btn-primary:hover { background: #00b894; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0, 212, 170, 0.3); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-secondary {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 20px;
    font-family: var(--font);
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    min-height: 44px;
}
.btn-secondary:hover { border-color: var(--teal); background: var(--bg-card-hover); }

.btn-back {
    display: inline-flex; align-items: center; gap: 4px;
    background: none; border: none;
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 13px; font-weight: 500;
    cursor: pointer;
    padding: 8px 0;
    transition: var(--transition);
}
.btn-back:hover { color: var(--teal); }

/* ── Assessment Layout ─────────────────────────────────────────── */
.assessment-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    margin-bottom: 32px;
}
@media (max-width: 768px) {
    .assessment-layout { grid-template-columns: 1fr; }
}

/* ── Score Card / Gauge ────────────────────────────────────────── */
.score-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    height: fit-content;
    position: sticky;
    top: 80px;
}
.gauge-container { position: relative; width: 120px; height: 120px; margin: 0 auto 20px; }
.gauge { width: 100%; height: 100%; }
.gauge-value {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -55%);
    font-size: 32px; font-weight: 900; color: var(--teal);
}
.gauge-label {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, 50%);
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--text-secondary);
}
.score-breakdown { text-align: left; margin-top: 16px; }
.score-breakdown .breakdown-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid rgba(46, 46, 74, 0.5);
    font-size: 12px;
}
.breakdown-item .breakdown-label { color: var(--text-secondary); }
.breakdown-item .breakdown-value { font-weight: 700; color: var(--text-primary); }
.breakdown-item .breakdown-bar {
    flex: 1; margin: 0 8px; height: 3px;
    background: var(--bg-deep); border-radius: 2px; overflow: hidden;
}
.breakdown-item .breakdown-fill { height: 100%; border-radius: 2px; background: var(--teal); transition: width 0.8s ease; }

/* ── Assessment Chat Area ─────────────────────────────────────── */
.assessment-chat-area { display: flex; flex-direction: column; gap: 16px; }

.btn-proceed {
    margin-top: 8px;
    width: 100%;
    justify-content: center;
}

/* ── Chat Container ───────────────────────────────────────────── */
.chat-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.chat-messages {
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.chat-bubble {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    line-height: 1.6;
    animation: fadeIn 0.2s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}
.chat-bubble.assistant {
    align-self: flex-start;
    background: var(--bg-surface);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}
.chat-bubble.user {
    align-self: flex-end;
    background: var(--teal);
    color: var(--text-inverse);
    border-bottom-right-radius: 4px;
}
.chat-bubble.generating {
    opacity: 0.7;
    font-style: italic;
}
.chat-bubble-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
    opacity: 0.7;
}

/* ── Chat Input Area ──────────────────────────────────────────── */
.chat-input-area {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    background: var(--bg-surface);
}
.chat-input-row {
    display: flex; gap: 8px; align-items: flex-end;
}
.chat-textarea {
    flex: 1;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 14px;
    resize: none;
    min-height: 40px;
    max-height: 120px;
    line-height: 1.5;
    transition: var(--transition);
}
.chat-textarea:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px var(--teal-dim);
}
.chat-textarea::placeholder { color: var(--text-muted); }

.chat-upload-btn,
.chat-send-btn {
    background: none;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    transition: var(--transition);
    display: flex; align-items: center; justify-content: center;
    min-width: 40px; min-height: 40px;
    flex-shrink: 0;
}
.chat-upload-btn:hover { border-color: var(--teal); color: var(--teal); }
.chat-send-btn { border-color: var(--teal); color: var(--teal); background: var(--teal-dim); }
.chat-send-btn:hover { background: var(--teal); color: var(--text-inverse); }

/* ── Briefing Preview ──────────────────────────────────────────── */
.briefing-preview {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.briefing-preview summary {
    padding: 14px 16px;
    font-size: 13px; font-weight: 600;
    cursor: pointer; color: var(--text-secondary);
    transition: var(--transition);
}
.briefing-preview summary:hover { color: var(--teal); }
.briefing-content {
    padding: 0 16px 16px;
    font-size: 13px; line-height: 1.7;
    color: var(--text-secondary);
    white-space: pre-wrap;
    max-height: 300px;
    overflow-y: auto;
}

/* ── Adapted Brief Card ────────────────────────────────────────── */
.adapted-brief-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    margin-bottom: 32px;
    backdrop-filter: blur(10px);
}
.adapted-brief-content {
    font-size: 14px; line-height: 1.8;
    color: var(--text-secondary);
    white-space: pre-wrap;
}
.adapted-brief-content h1, .adapted-brief-content h2, .adapted-brief-content h3 {
    color: var(--text-primary);
    margin: 24px 0 12px;
}

/* ── Persona Grid (Phase 4) ────────────────────────────────────── */
.persona-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}
@media (max-width: 768px) { .persona-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .persona-grid { grid-template-columns: 1fr; } }

.persona-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}
.persona-card.running {
    border-color: var(--amber);
    animation: pulse-border 2s ease-in-out infinite;
}
.persona-card.done { border-color: var(--teal); }
.persona-card.error { border-color: var(--red); }

@keyframes pulse-border {
    0%, 100% { box-shadow: 0 0 0 0 rgba(240, 165, 0, 0); }
    50% { box-shadow: 0 0 16px 0 rgba(240, 165, 0, 0.15); }
}

.persona-status {
    width: 10px; height: 10px; border-radius: 50%;
    position: absolute; top: 16px; right: 16px;
}
.status-waiting { background: var(--text-muted); }
.status-running { background: var(--amber); animation: blink 1s ease-in-out infinite; }
.status-done { background: var(--teal); }
.status-error { background: var(--red); }

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.persona-card h3 { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.persona-model { font-size: 12px; color: var(--teal); font-weight: 500; margin-bottom: 4px; }
.persona-approach { font-size: 12px; color: var(--text-muted); }

/* ── Ideation Progress Bar ─────────────────────────────────────── */
.ideation-progress { margin-bottom: 32px; text-align: center; }
.progress-bar-container {
    width: 100%; height: 6px;
    background: var(--bg-card); border-radius: 3px;
    overflow: hidden; margin-bottom: 12px;
}
.progress-bar {
    height: 100%; border-radius: 3px;
    background: linear-gradient(90deg, var(--teal), var(--amber));
    transition: width 0.5s ease;
}
.progress-text { font-size: 13px; color: var(--text-secondary); }

/* ── Celebration ───────────────────────────────────────────────── */
.celebration { text-align: center; margin-bottom: 16px; }
.celebration svg { animation: spin-in 0.5s ease; }
.celebration-text { font-size: 18px; font-weight: 700; color: var(--amber); margin-top: 8px; }
@keyframes spin-in {
    from { transform: scale(0) rotate(-180deg); opacity: 0; }
    to { transform: scale(1) rotate(0); opacity: 1; }
}

/* ── Curation Loading ──────────────────────────────────────────── */
.curation-loading { text-align: center; padding: 60px 0; }
.curation-loading p { font-size: 16px; color: var(--text-secondary); margin-top: 16px; }
.curation-loading .loader-sub { font-size: 13px; color: var(--text-muted); }

.loader {
    width: 40px; height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--teal);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Curated Ideas Grid ────────────────────────────────────────── */
.curated-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}
@media (max-width: 480px) { .curated-grid { grid-template-columns: 1fr; } }

.idea-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
}
.idea-card:hover { border-color: rgba(0, 212, 170, 0.3); transform: translateY(-2px); }

.idea-card-header {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 20px;
    background: rgba(0, 212, 170, 0.04);
    border-bottom: 1px solid var(--border);
}
.idea-rank {
    min-width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 13px; font-weight: 900;
    background: var(--teal); color: var(--text-inverse);
}
.idea-rank.top3 { background: var(--amber); }
.idea-card-header h3 { font-size: 15px; font-weight: 700; flex: 1; }
.idea-score {
    font-size: 14px; font-weight: 700; color: var(--teal);
    background: var(--teal-dim); padding: 2px 10px; border-radius: 12px;
}

.idea-card-body { padding: 16px 20px; }
.idea-persona-tag {
    display: inline-block;
    font-size: 11px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--amber); background: var(--amber-dim);
    padding: 2px 8px; border-radius: 4px;
    margin-bottom: 10px;
}
.idea-text { font-size: 14px; color: var(--text-secondary); line-height: 1.7; white-space: pre-wrap; }

.idea-card-details {
    padding: 0 20px 16px;
}
.idea-toggle {
    font-size: 12px; color: var(--teal);
    cursor: pointer; font-weight: 600;
    display: flex; align-items: center; gap: 4px;
    background: none; border: none; font-family: var(--font);
    padding: 4px 0; margin-top: 8px;
}
.idea-toggle:hover { text-decoration: underline; }

.idea-review {
    margin-top: 12px; padding-top: 12px;
    border-top: 1px solid var(--border);
}
.idea-review-row {
    display: flex; gap: 8px; margin-bottom: 8px; font-size: 13px;
}
.idea-review-label {
    font-weight: 600; color: var(--text-muted);
    min-width: 90px; flex-shrink: 0;
}
.idea-review-value { color: var(--text-secondary); }

/* ── Phase Actions ─────────────────────────────────────────────── */
.phase-actions { text-align: center; padding: 16px 0; }

/* ── Report Page ───────────────────────────────────────────────── */
.report-actions {
    display: flex; gap: 12px; margin-bottom: 24px;
    flex-wrap: wrap;
}
.report-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
    margin-bottom: 48px;
}
@media (max-width: 480px) { .report-grid { grid-template-columns: 1fr; } }

/* ── Image Prompts ─────────────────────────────────────────────── */
.image-prompts-section { margin-top: 32px; }
.image-prompts-section h2 {
    font-size: 20px; font-weight: 700; margin-bottom: 16px;
    color: var(--amber);
}
.prompts-list { display: flex; flex-direction: column; gap: 12px; }
.prompt-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
}
.prompt-item-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 8px;
}
.prompt-item-rank { font-weight: 700; color: var(--teal); font-size: 13px; }
.prompt-item-title { font-weight: 600; font-size: 14px; }
.prompt-item-text { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }
.prompt-item-image {
    margin-top: 12px;
}
.prompt-item-image:empty { display: none; }
.prompt-generated-image {
    width: 100%;
    max-width: 640px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

/* ── Idea Card Images ─────────────────────────────────────────── */
.idea-card-image {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: rgba(255,255,255,0.02);
}
.idea-image-placeholder {
    width: 100%; height: 100%;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 8px;
    color: var(--text-muted);
    opacity: 0.4;
    font-size: 12px;
}
.idea-generated-image {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}

/* ── Image Gen Progress ─────────────────────────────────────── */
.image-gen-progress {
    margin-bottom: 20px;
    display: flex; align-items: center; gap: 12px;
}
.image-gen-progress-bar {
    flex: 1; height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}
.image-gen-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--teal), var(--amber));
    border-radius: 3px;
    width: 0%;
    transition: width 0.5s ease;
}
.image-gen-progress-text {
    font-size: 12px; color: var(--text-muted);
    white-space: nowrap;
}

.spin {
    animation: spin 1s linear infinite;
}
.btn-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── Refinement Section ───────────────────────────────────────── */
.refinement-section { margin-top: 48px; }
.refinement-divider {
    display: flex; align-items: center; gap: 16px;
    margin-bottom: 24px;
}
.refinement-divider::before,
.refinement-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}
.refinement-divider span {
    font-size: 16px; font-weight: 700;
    color: var(--amber);
    white-space: nowrap;
}

.refinement-chat-container {
    min-height: 200px;
}
.refinement-chat-container .chat-messages {
    max-height: 350px;
}

.refinement-actions {
    display: flex; gap: 8px; margin-top: 8px;
    justify-content: flex-end;
}
.btn-generate-more {
    background: var(--amber-dim);
    color: var(--amber);
    border-color: rgba(240, 165, 0, 0.3);
    font-size: 13px;
    padding: 8px 16px;
}
.btn-generate-more:hover {
    background: rgba(240, 165, 0, 0.25);
    border-color: var(--amber);
}

/* ── Loading Overlay ───────────────────────────────────────────── */
.loading-overlay {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(17, 17, 24, 0.85);
    backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: center;
}
.loading-content { text-align: center; }
.loading-text { font-size: 16px; color: var(--text-secondary); margin-top: 16px; }

/* ── Toast ──────────────────────────────────────────────────────── */
.toast {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
    background: var(--red); color: white;
    padding: 12px 24px; border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 600;
    z-index: 2000;
    animation: toast-in 0.3s ease;
}
.toast.success { background: var(--teal); color: var(--text-inverse); }
@keyframes toast-in {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .main { padding: 24px 16px 48px; }
    .stepper-inner { justify-content: flex-start; }
    .step-label { display: none; }
    .assessment-layout { grid-template-columns: 1fr; }
    .score-card { position: static; }
    .type-grid, .level-grid { grid-template-columns: 1fr 1fr; }
    .persona-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
    .type-grid, .level-grid { grid-template-columns: 1fr; }
    .form-actions { flex-direction: column; align-items: stretch; }
    .chat-input-row { flex-wrap: nowrap; }
}
