/* AdGenerator – Custom CSS */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --sidebar-active: #1d4ed8;
    --sidebar-text: #94a3b8;
    --sidebar-text-active: #f1f5f9;
    --main-bg: #f8fafc;
    --card-bg: #ffffff;
    --border: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: #eef2ff;
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .06), 0 1px 2px rgba(0, 0, 0, .04);
    --shadow: 0 4px 12px rgba(0, 0, 0, .08), 0 1px 3px rgba(0, 0, 0, .04);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, .12), 0 2px 8px rgba(0, 0, 0, .06);
}

html,
body {
    height: 100%;
    font-family: 'Geist', 'Google Sans', 'Inter', system-ui, sans-serif;
    font-size: 15px;
    color: var(--text-primary);
    background: var(--main-bg);
}


/* ─── App Shell ─────────────────────────────────────────────────────── */

.app-shell {
    display: flex;
    height: 100vh;
    overflow: hidden;
}


/* ─── Sidebar ───────────────────────────────────────────────────────── */

.sidebar {
    width: 260px;
    min-width: 260px;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255, 255, 255, .06);
    overflow: hidden;
}

.sidebar-header {
    padding: 20px 16px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
    flex-shrink: 0;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.sidebar-logo-icon {
    width: 34px;
    height: 34px;
    background: var(--primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #fff;
    flex-shrink: 0;
}

.sidebar-logo-name {
    font-size: 16px;
    font-weight: 700;
    color: #f8fafc;
    letter-spacing: -.3px;
}

.btn-new-session {
    width: 100%;
    padding: 9px 12px;
    background: rgba(99, 102, 241, .15);
    border: 1px solid rgba(99, 102, 241, .3);
    border-radius: var(--radius-sm);
    color: #a5b4fc;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all .15s ease;
}

.btn-new-session:hover {
    background: rgba(99, 102, 241, .25);
    color: #c7d2fe;
}

.sidebar-section-label {
    padding: 12px 16px 6px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(148, 163, 184, .5);
    flex-shrink: 0;
}

.sessions-list {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 8px;
}

.sessions-list::-webkit-scrollbar {
    width: 4px;
}

.sessions-list::-webkit-scrollbar-track {
    background: transparent;
}

.sessions-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .1);
    border-radius: 2px;
}

.session-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px 9px 16px;
    margin: 1px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background .12s ease;
    position: relative;
    group: true;
}

.session-item:hover {
    background: var(--sidebar-hover);
}

.session-item.active {
    background: rgba(99, 102, 241, .2);
}

.session-item .session-icon {
    color: var(--sidebar-text);
    font-size: 13px;
    flex-shrink: 0;
}

.session-item.active .session-icon {
    color: #a5b4fc;
}

.session-item .session-name {
    flex: 1;
    font-size: 13px;
    color: var(--sidebar-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.session-item.active .session-name {
    color: var(--sidebar-text-active);
    font-weight: 500;
}

.session-item .session-meta {
    font-size: 11px;
    color: rgba(148, 163, 184, .4);
    flex-shrink: 0;
}

.session-item .btn-delete-session {
    opacity: 0;
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    transition: all .12s;
    flex-shrink: 0;
    font-size: 12px;
}

.session-item:hover .btn-delete-session {
    opacity: 1;
}

.session-item .btn-delete-session:hover {
    background: rgba(239, 68, 68, .15);
    color: #ef4444;
}

.session-name-input {
    flex: 1;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(99, 102, 241, .4);
    border-radius: 4px;
    padding: 2px 6px;
    color: #f1f5f9;
    font-size: 13px;
    outline: none;
    min-width: 0;
}

.sidebar-footer {
    padding: 12px 8px;
    border-top: 1px solid rgba(255, 255, 255, .06);
    flex-shrink: 0;
}

.btn-settings {
    width: 100%;
    padding: 9px 12px;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all .12s ease;
}

.btn-settings:hover {
    background: var(--sidebar-hover);
    color: #f1f5f9;
}


/* ─── Main Content ──────────────────────────────────────────────────── */

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.topbar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
}

.topbar-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 0;
    flex-shrink: 0;
}

.topbar-title-wrap {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    min-width: 0;
}

.topbar-title-editable {
    cursor: text;
    border-radius: var(--radius-sm);
    padding: 3px 6px;
    margin: 0 -6px;
    transition: background .15s;
}

.topbar-title-editable:hover {
    background: #f1f5f9;
}

.topbar-title-input {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    font-family: inherit;
    border: 1.5px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: 2px 8px;
    outline: none;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .1);
    min-width: 140px;
    max-width: 320px;
    width: auto;
}

.topbar-spacer {
    flex: 1;
}

.topbar-stats {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.content-area::-webkit-scrollbar {
    width: 6px;
}

.content-area::-webkit-scrollbar-track {
    background: transparent;
}

.content-area::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}


/* ─── Buttons ───────────────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all .15s ease;
    white-space: nowrap;
    text-decoration: none;
}

.btn:disabled {
    opacity: .5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.btn-secondary {
    background: #fff;
    color: var(--text-primary);
    border-color: var(--border);
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.btn-success {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}

.btn-success:hover {
    background: #059669;
    border-color: #059669;
}

.btn-danger {
    background: transparent;
    color: var(--danger);
    border-color: #fecaca;
}

.btn-danger:hover {
    background: var(--danger-light);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: transparent;
}

.btn-ghost:hover {
    background: #f1f5f9;
}

.btn-sm {
    padding: 5px 11px;
    font-size: 12px;
}

.btn-icon {
    padding: 8px;
}

.btn-upload {
    background: var(--primary-light);
    color: var(--primary);
    border-color: #c7d2fe;
}

.btn-upload:hover {
    background: #e0e7ff;
}

.btn-export {
    background: #f0fdf4;
    color: #15803d;
    border-color: #bbf7d0;
}

.btn-export:hover {
    background: #dcfce7;
}

.btn-add-prompt {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.btn-add-prompt:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.form-textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--text-primary);
    background: #fafafa;
    resize: vertical;
    outline: none;
    font-family: inherit;
    transition: border-color .15s, background .15s;
    min-height: 120px;
}

.form-textarea:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .08);
}


/* ─── Empty / Welcome State ─────────────────────────────────────────── */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 24px;
    text-align: center;
    height: 100%;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: .4;
}

.empty-state h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    color: var(--text-muted);
    max-width: 380px;
    line-height: 1.6;
    margin-bottom: 24px;
}


/* ─── Prompt Grid ───────────────────────────────────────────────────── */

.prompts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}


/* ─── Prompt Card ───────────────────────────────────────────────────── */

.prompt-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow .2s ease, border-color .2s ease;
    display: flex;
    flex-direction: column;
}

.prompt-card:hover {
    box-shadow: var(--shadow);
}

.prompt-card.selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, .15), var(--shadow);
}

.prompt-card.generating {
    border-color: var(--warning);
}

.card-header {
    padding: 14px 16px 10px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border-bottom: 1px solid #f1f5f9;
}

.card-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
    margin-top: 1px;
    flex-shrink: 0;
}

.card-title-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    min-width: 0;
    padding: 0;
}

.card-title-input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.card-index {
    font-size: 11px;
    color: var(--text-muted);
    flex-shrink: 0;
    margin-top: 2px;
}

.card-body {
    padding: 12px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.prompt-textarea {
    width: 100%;
    min-height: 150px;
    max-height: 280px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--text-primary);
    background: #fafafa;
    resize: vertical;
    outline: none;
    font-family: inherit;
    transition: border-color .15s, background .15s;
}

.prompt-textarea:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .08);
}

.card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-actions .spacer {
    flex: 1;
}


/* ─── Generated Images ──────────────────────────────────────────────── */

.generated-images {
    padding: 0 16px 14px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
}

.generated-images:empty {
    display: none;
}

.gen-image-wrap {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #f1f5f9;
    border: 1px solid var(--border);
    cursor: pointer;
}

.gen-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .2s ease;
}

.gen-image-wrap:hover img {
    transform: scale(1.04);
}

.gen-image-meta {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, .7));
    padding: 12px 6px 5px;
    font-size: 10px;
    color: rgba(255, 255, 255, .8);
    opacity: 0;
    transition: opacity .15s;
}

.gen-image-wrap:hover .gen-image-meta {
    opacity: 1;
}


/* ─── Generation Spinner ────────────────────────────────────────────── */

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(99, 102, 241, .2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .7s linear infinite;
    flex-shrink: 0;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.generating-overlay {
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    background: var(--primary-light);
    border: 1px dashed #a5b4fc;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 11px;
    color: var(--primary);
}

.generating-overlay .spinner {
    border-top-color: var(--primary);
    border-color: rgba(99, 102, 241, .2);
}


/* ─── Toast Notifications ───────────────────────────────────────────── */

.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 9999;
    pointer-events: none;
}

.toast {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn .2s ease;
    pointer-events: all;
    max-width: 340px;
}

@keyframes slideIn {
    from {
        transform: translateX(20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    background: #fff;
    border-left: 3px solid var(--success);
}

.toast.error {
    background: #fff;
    border-left: 3px solid var(--danger);
}

.toast.info {
    background: #fff;
    border-left: 3px solid var(--primary);
}

.toast .toast-icon {
    font-size: 15px;
}

.toast.success .toast-icon {
    color: var(--success);
}

.toast.error .toast-icon {
    color: var(--danger);
}

.toast.info .toast-icon {
    color: var(--primary);
}


/* ─── Modal ─────────────────────────────────────────────────────────── */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.modal {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn .2s ease;
}

@keyframes modalIn {
    from {
        transform: scale(.96) translateY(-8px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-header h2 {
    font-size: 16px;
    font-weight: 600;
    flex: 1;
}

.modal-body {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}


/* ─── Form Fields ───────────────────────────────────────────────────── */

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.form-input,
.form-select {
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    color: var(--text-primary);
    background: #fff;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    width: 100%;
    font-family: inherit;
}

.form-input:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .1);
}

.form-input.api-key {
    font-family: 'Courier New', monospace;
    font-size: 12.5px;
    letter-spacing: .02em;
}

.form-hint {
    font-size: 11.5px;
    color: var(--text-muted);
    line-height: 1.5;
}


/* ─── Image Lightbox ────────────────────────────────────────────────── */

.lightbox-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
    cursor: zoom-out;
}

.lightbox-img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
    object-fit: contain;
}

.lightbox-close {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, .1);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, .2);
}


/* ─── Upload Zone ───────────────────────────────────────────────────── */

.upload-zone {
    border: 2px dashed #c7d2fe;
    border-radius: var(--radius-lg);
    padding: 40px 24px;
    text-align: center;
    background: var(--primary-light);
    cursor: pointer;
    transition: all .15s ease;
    margin-bottom: 24px;
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--primary);
    background: #e0e7ff;
}

.upload-zone-icon {
    font-size: 32px;
    color: var(--primary);
    margin-bottom: 10px;
}

.upload-zone p {
    font-size: 14px;
    color: var(--primary);
    font-weight: 500;
    margin-bottom: 4px;
}

.upload-zone span {
    font-size: 12px;
    color: #818cf8;
}


/* ─── Batch progress bar ────────────────────────────────────────────── */

.progress-bar-wrap {
    background: #e2e8f0;
    border-radius: 99px;
    height: 6px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 99px;
    transition: width .3s ease;
}


/* ─── Selection bar ─────────────────────────────────────────────────── */

.selection-bar {
    background: var(--primary);
    color: #fff;
    padding: 10px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 500;
    flex-shrink: 0;
    animation: slideDown .15s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.selection-bar .spacer {
    flex: 1;
}


/* ─── Scrollbar  ────────────────────────────────────────────────────── */

* {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}


/* ─── Model Picker ──────────────────────────────────────────────────── */

.model-picker {
    position: relative;
}

.model-picker-trigger {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    font-size: 13.5px;
    transition: border-color .15s, box-shadow .15s;
}

.model-picker-trigger:hover {
    border-color: #94a3b8;
}

.model-picker-trigger:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .1);
}

.model-trigger-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.model-trigger-name {
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.model-trigger-prices {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
}

.price-badge {
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 99px;
    font-weight: 500;
    white-space: nowrap;
}

.price-in {
    background: #eff6ff;
    color: #1d4ed8;
}

.price-out {
    background: #f0fdf4;
    color: #15803d;
}

.model-picker-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 200;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.model-picker-search-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-bottom: 1px solid var(--border);
    background: #fafafa;
}

.model-picker-search-wrap i {
    color: var(--text-muted);
    font-size: 13px;
    flex-shrink: 0;
}

.model-picker-search {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 13px;
    color: var(--text-primary);
    font-family: inherit;
}

.model-picker-search::placeholder {
    color: var(--text-muted);
}

.model-picker-list {
    max-height: 260px;
    overflow-y: auto;
}

.model-option {
    padding: 9px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    transition: background .1s;
    border-bottom: 1px solid #f8fafc;
}

.model-option:hover {
    background: #f8fafc;
}

.model-option.active {
    background: var(--primary-light);
}

.model-option-info {
    flex: 1;
    min-width: 0;
}

.model-option-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.model-option-id {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 1px;
}

.model-option-prices {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.model-picker-empty {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* ══════════════════════════════════════════════════════════════════════════
   IMAGES NAV — sidebar button
══════════════════════════════════════════════════════════════════════════ */
.btn-images-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.btn-images-nav:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
    border-color: var(--primary);
}
.btn-images-nav.active {
    background: color-mix(in srgb, var(--primary) 12%, transparent);
    color: var(--primary);
    border-color: var(--primary);
}
.images-nav-badge {
    margin-left: auto;
    background: var(--primary);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 20px;
    line-height: 1.6;
}

/* ══════════════════════════════════════════════════════════════════════════
   GALLERY — date accordion groups
══════════════════════════════════════════════════════════════════════════ */
.gallery-group {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.gallery-group-header {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    transition: background var(--transition);
    text-align: left;
}
.gallery-group-header:hover { background: var(--surface-hover); }
.gallery-group-date { font-family: var(--font-mono, monospace); letter-spacing: 0.02em; }
.gallery-group-count {
    background: var(--surface-hover);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
}
.gallery-group-chevron {
    color: var(--text-muted);
    font-size: 11px;
    transition: transform 0.2s ease;
}

/* ══════════════════════════════════════════════════════════════════════════
   GALLERY — image grid & cards
══════════════════════════════════════════════════════════════════════════ */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 2px;
    padding: 2px;
    background: var(--border);
}
.gallery-item {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    cursor: pointer;
    background: var(--surface-hover);
}
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.25s ease;
}
.gallery-item:hover img { transform: scale(1.05); }
.gallery-item-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.88) 0%, rgba(0,0,0,0.45) 55%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 10px;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.gallery-item:hover .gallery-item-overlay { opacity: 1; }
.gallery-item-title {
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}
.gallery-item-model {
    font-size: 10px;
    color: rgba(255,255,255,0.7);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gallery-item-session {
    font-size: 10px;
    color: rgba(255,255,255,0.55);
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gallery-item-dl {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease, background 0.15s;
    backdrop-filter: blur(4px);
}
.gallery-item:hover .gallery-item-dl { opacity: 1; }
.gallery-item-dl:hover { background: var(--primary); }

/* ══════════════════════════════════════════════════════════════════════════
   GALLERY LIGHTBOX
══════════════════════════════════════════════════════════════════════════ */
.gallery-lightbox-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    backdrop-filter: blur(6px);
}
.gallery-lightbox-inner {
    position: relative;
    display: flex;
    gap: 0;
    max-width: 1100px;
    width: 100%;
    max-height: 90vh;
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 32px 80px rgba(0,0,0,0.5);
}
.gallery-lightbox-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.45);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    transition: background 0.15s;
}
.gallery-lightbox-close:hover { background: var(--danger); }
.gallery-lightbox-img-pane {
    flex: 1 1 60%;
    min-width: 0;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.gallery-lightbox-img-pane img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    display: block;
}
.gallery-lightbox-meta {
    flex: 0 0 320px;
    padding: 28px 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    border-left: 1px solid var(--border);
}
.gallery-lightbox-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}
.gallery-lightbox-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
}
.badge-model {
    background: color-mix(in srgb, var(--primary) 15%, transparent);
    color: var(--primary);
}
.badge-session {
    background: var(--surface-hover);
    color: var(--text-secondary);
}
.gallery-lightbox-section-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.gallery-lightbox-prompt {
    font-size: 12px;
    line-height: 1.7;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-word;
    flex: 1;
}
.gallery-lightbox-dl {
    margin-top: auto;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}