:root {
    --bg:           #050607;
    --bg-card:      #0D0F12;
    --bg-input:     #121417;
    --bg-hover:     #171A1E;
    --border:       rgba(255,255,255,0.08);
    --text:         #FFF4F8;
    --text-dim:     #B8AEB5;
    --text-muted:   #7E757C;
    --accent:       #FF2E88;
    --accent-hover: #FF4FB3;
    --accent-glow:  rgba(255,46,136,0.14);
    --accent-nude:  #FF8AC8;
    --accent-sage:  #7CFFD8;
    --accent-sand:  #B7FFE8;
    --mint:         #7CFFD8;
    --mint-dim:     rgba(124,255,216,0.18);
    --danger:       #FF4545;
    --success:      #4db870;
    --radius:       14px;
    --radius-sm:    9px;
    --font:         'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    --glow-pink:    0 0 24px rgba(255,46,136,0.32);
    --glow-mint:    0 0 22px rgba(124,255,216,0.22);
    --gradient-cta: linear-gradient(135deg, #FF2E88 0%, #FF4FB3 52%, #7CFFD8 100%);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100dvh; -webkit-font-smoothing: antialiased; }

/* ── Logo wordmark ─────────────────────────────────────────────────────────── */
.logo {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0.01em;
    line-height: 1;
}
.badge {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-dim);
    background: var(--bg-input);
    border: 1px solid var(--border);
    padding: 2px 7px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ── App layout ────────────────────────────────────────────────────────────── */
.app-layout { display: flex; min-height: 100dvh; }
.sidebar {
    position: fixed; top: 0; left: 0; right: 0; width: 100%; height: 56px;
    background: linear-gradient(180deg, #08090B 0%, #06070A 100%);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex; flex-direction: row; align-items: center;
    z-index: 150; padding: 0 18px; gap: 16px;
}
.sidebar-logo { display: flex; flex-direction: row; align-items: center; padding: 0; border-bottom: none; gap: 8px; flex-shrink: 0; }
.sidebar-logo-img { width: 30px; height: auto; display: block; }
.sidebar-brand-text { font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 700; letter-spacing: 0.18em; color: var(--text-dim); text-transform: uppercase; }
.brand-dot { color: var(--accent); }
.nav-logo-img { height: 40px; width: auto; display: block; }
.sidebar-nav { display: flex; flex-direction: row; gap: 4px; margin-right: auto; }
.sidebar-btn {
    padding: 8px 14px;
    border: 1px solid transparent; border-radius: var(--radius-sm);
    background: transparent; color: var(--text-dim);
    font-family: var(--font); font-size: 13px; font-weight: 500;
    cursor: pointer; transition: all 0.18s; text-align: center; white-space: nowrap;
}
.sidebar-btn:hover { background: rgba(124,255,216,0.06); color: var(--text); border-color: rgba(124,255,216,0.18); }
.sidebar-btn.active { background: rgba(255,46,136,0.12); color: var(--text); font-weight: 600; border-color: rgba(255,46,136,0.35); box-shadow: 0 0 18px rgba(255,46,136,0.18); }
.main-content { flex: 1; margin-left: 0; margin-top: 56px; min-width: 0; position: relative; }
.mobile-account-btn { display: none; }

/* ── Generator ─────────────────────────────────────────────────────────────── */
.generator { border-bottom: 1px solid var(--border); background: radial-gradient(circle at top left, rgba(255,46,136,0.07), transparent 40%), var(--bg-card); }
.generator-inner {
    padding: 16px 20px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    gap: 16px;
    align-items: start;
}
.generator-left { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.generator-controls-bar { display: flex; align-items: stretch; flex-direction: column; gap: 10px; padding: 10px 12px; background: rgba(255,255,255,0.02); border: 1px solid var(--border); border-radius: var(--radius); }
.generator-controls-bar .generate-btn { margin-left: 0; width: 100%; }
.ctrl-label, .resolution-label { font-size: 10px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; white-space: nowrap; }
.prompt-mode-tabs { display: flex; gap: 4px; margin-bottom: 4px; }
.tab-btn {
    padding: 7px 15px; border: 1px solid var(--border);
    border-radius: var(--radius-sm); background: var(--bg-input);
    color: var(--text-dim); font-family: var(--font); font-size: 13px;
    font-weight: 500; cursor: pointer; transition: all 0.18s;
}
.tab-btn:hover { border-color: var(--accent); color: var(--text); }
.tab-btn.active { border-color: var(--accent); background: var(--accent-glow); color: var(--text); }
.prompt-content { width: 100%; }
.prompt-row { width: 100%; }
.prompt-input {
    width: 100%; background: var(--bg-input);
    border: 1px solid var(--border); border-radius: var(--radius);
    color: var(--text); font-family: var(--font); font-size: 15px;
    padding: 14px 16px; resize: vertical; min-height: 80px; max-height: 200px; line-height: 1.5;
}
.prompt-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.prompt-input-sm { min-height: 50px; max-height: 120px; }
.prompt-starters { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.prompt-starters-label { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.prompt-chip {
    border: 1px solid var(--border); border-radius: 999px;
    background: rgba(255,255,255,0.03); color: var(--text-dim);
    font-family: var(--font); font-size: 12px; font-weight: 600;
    padding: 6px 11px; cursor: pointer;
    transition: border-color 0.16s, color 0.16s, background 0.16s;
}
.prompt-chip:hover { border-color: rgba(255,46,136,0.55); color: var(--text); background: var(--accent-glow); }
.controls-row { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.lora-controls { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; padding: 10px 14px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.resolution-controls { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; padding: 4px 10px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.resolution-btn { padding: 4px 11px; border-radius: var(--radius-sm); border: 1px solid transparent; background: transparent; color: var(--text-dim); font-size: 12px; font-weight: 500; cursor: pointer; transition: all 0.15s; text-align: center; line-height: 1.2; }
.resolution-btn:hover { color: var(--text); }
.resolution-btn.active { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.lora-row { display: flex; align-items: center; gap: 12px; }
.lora-label { font-size: 12px; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap; min-width: 90px; }
.lora-slider { flex: 1; accent-color: var(--accent); cursor: pointer; }
.lora-value { font-size: 13px; font-weight: 600; color: var(--text); min-width: 32px; text-align: right; }
.control-label { display: block; font-size: 11px; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 6px; }
.preset-group { flex: 1; min-width: 200px; }
.preset-buttons { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; padding: 4px 10px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.preset-btn {
    padding: 6px 13px; border: 1px solid transparent;
    border-radius: var(--radius-sm); background: transparent;
    color: var(--text-dim); font-family: var(--font); font-size: 13px;
    font-weight: 600; cursor: pointer; transition: all 0.18s; white-space: nowrap;
}
.preset-btn:hover { color: var(--text); }
.preset-btn.active { border-color: var(--accent); background: var(--accent-glow); color: var(--text); }
.generate-btn {
    padding: 10px 28px; border: none; border-radius: var(--radius-sm);
    background: var(--gradient-cta); color: #050607;
    font-family: var(--font); font-size: 15px; font-weight: 700;
    cursor: pointer; transition: all 0.2s; white-space: nowrap;
    min-width: 140px; height: 40px; display: flex; align-items: center; justify-content: center; gap: 8px;
    box-shadow: 0 0 24px rgba(255,46,136,0.36), 0 0 18px rgba(124,255,216,0.18);
}
.generate-btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 0 32px rgba(255,46,136,0.48), 0 0 26px rgba(124,255,216,0.24); opacity: 0.92; }
.generate-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }
/* one generation at a time: lock all triggers while a request is in flight */
body.is-generating .card-regenerate,
body.is-generating .lightbox-regenerate,
body.is-generating .lightbox-animate,
body.is-generating .card-animate-featured,
body.is-generating .card-recreate-primary,
body.is-generating #animate-submit-btn { opacity: 0.45; pointer-events: none; cursor: not-allowed; }
body.is-generating .generate-btn { opacity: 0.5; pointer-events: none; }
.btn-loader { display: flex; align-items: center; gap: 8px; }
.btn-timer { font-variant-numeric: tabular-nums; font-size: 13px; }
.spinner { width: 16px; height: 16px; border: 2px solid rgba(0,0,0,0.25); border-top-color: var(--bg); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.status { font-size: 13px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--bg-input); border: 1px solid var(--border); }
.status.error { border-color: var(--danger); color: var(--danger); background: rgba(217,80,64,0.07); }
.status.success { border-color: var(--success); color: var(--success); background: rgba(77,184,112,0.07); }

/* ── Gallery ───────────────────────────────────────────────────────────────── */
.gallery-section { padding: 18px 24px 20px; scroll-margin-top: 64px; }
.content-tabs {
    display: none; /* duplicate of the sidebar / bottom nav — one nav source only */
    gap: 6px;
    margin-bottom: 14px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(255,255,255,0.025);
    overflow-x: auto;
    scrollbar-width: none;
}
.content-tabs::-webkit-scrollbar { display: none; }
.content-tab {
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-dim);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 700;
    padding: 9px 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.16s, color 0.16s, box-shadow 0.16s;
}
.content-tab:hover { background: rgba(124,255,216,0.06); color: var(--text); }
.content-tab.active { background: var(--accent-glow); color: var(--text); box-shadow: inset 0 0 0 1px rgba(255,46,136,0.35); }
.gallery-header { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.gallery-title { font-size: 17px; font-weight: 600; }
.gallery-count { font-size: 13px; color: var(--text-dim); }
.gallery-per-page { display: flex; align-items: center; gap: 8px; }
.per-page-label { font-size: 13px; color: var(--text-dim); }
.per-page-btns { display: flex; gap: 4px; }
.per-page-btn { padding: 5px 11px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-input); color: var(--text-dim); font-family: var(--font); font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.18s; }
.per-page-btn:hover { border-color: var(--accent); color: var(--text); }
.per-page-btn.active { border-color: var(--accent); background: var(--accent-glow); color: var(--text); }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.featured-info-details { margin-top: 8px; }
.featured-info-details summary { cursor: pointer; font-size: 12px; font-weight: 600; color: var(--accent); padding: 4px 0; user-select: none; }
.featured-info-details summary:hover { color: var(--text); }
.featured-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; margin-top: 8px; font-size: 12px; line-height: 1.6; }
.gallery-card.featured-card .card-delete { display: none; }
.gallery-empty { text-align: center; color: var(--text-dim); padding: 60px 20px; font-size: 15px; }
.empty-state {
    max-width: 440px; margin: 24px auto; padding: 42px 24px;
    border: 1px solid var(--border); border-radius: var(--radius);
    background: rgba(255,255,255,0.02);
}
.empty-state h3 { margin: 0 0 8px; color: var(--text); font-size: 18px; font-weight: 700; }
.empty-state p { margin: 0 auto 18px; max-width: 340px; color: var(--text-dim); line-height: 1.55; font-size: 13px; }
.empty-state-actions { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.empty-state-btn {
    border: none; border-radius: var(--radius-sm);
    background: var(--accent); color: var(--bg);
    font-family: var(--font); font-size: 13px; font-weight: 700;
    padding: 10px 18px; cursor: pointer;
    transition: background 0.18s, transform 0.15s;
}
.empty-state-btn:hover { background: var(--accent-hover); transform: translateY(-1px); }
.empty-state-btn-secondary {
    background: var(--bg-input); color: var(--text-dim);
    border: 1px solid var(--border);
}
.empty-state-btn-secondary:hover { background: var(--bg-hover); color: var(--text); border-color: var(--text-muted); }

.gallery-pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 20px; padding: 12px 0; flex-wrap: wrap; }
.pagination-btn { padding: 8px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-input); color: var(--text); font-family: var(--font); font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.18s; }
.pagination-btn:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-glow); }
.pagination-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.pagination-pages { display: flex; align-items: center; gap: 4px; }
.pagination-num { min-width: 36px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-input); color: var(--text); font-family: var(--font); font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.18s; }
.pagination-num:hover { border-color: var(--accent); background: var(--accent-glow); }
.pagination-num.active { border-color: var(--accent); background: var(--accent-glow); cursor: default; }
.pagination-ellipsis { padding: 0 6px; font-size: 14px; color: var(--text-dim); user-select: none; }

.gallery-card { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--bg-card); border: 1px solid var(--border); cursor: pointer; transition: transform 0.2s, border-color 0.2s; }
.gallery-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.gallery-card img { width: 100%; aspect-ratio: 832/1216; object-fit: cover; display: block; }
.gallery-card video { width: 100%; aspect-ratio: 832/1216; object-fit: cover; display: block; background: #111; }
.card-overlay { position: absolute; bottom: 0; left: 0; right: 0; z-index: 5; background: linear-gradient(transparent, rgba(0,0,0,0.88)); padding: 30px 10px 10px; opacity: 0; transition: opacity 0.2s; }
.gallery-card:hover .card-overlay { opacity: 1; }
.card-overlay-row { display: flex; align-items: center; gap: 8px; min-height: 0; }
.card-prompt { font-size: 12px; color: #ddd; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; flex: 1; min-width: 0; }
.card-overlay .card-copy-prompt { flex-shrink: 0; padding: 4px 10px; font-size: 11px; border: 1px solid rgba(255,255,255,0.35); background: rgba(0,0,0,0.4); color: #ddd; border-radius: var(--radius-sm); font-family: var(--font); cursor: pointer; transition: background 0.18s, border-color 0.18s; }
.card-overlay .card-copy-prompt:hover { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.card-actions { position: absolute; top: 8px; left: 8px; z-index: 5; display: flex; gap: 6px; opacity: 0; transition: opacity 0.2s; }
.featured-card .card-actions {
    top: 50%; left: 50%;
    justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap;
    width: calc(100% - 24px); max-width: 260px;
    transform: translate(-50%, -50%);
}
.gallery-card:hover .card-actions { opacity: 1; }
.card-download, .card-regenerate, .card-copy-prompt { padding: 6px 12px; border: none; border-radius: var(--radius-sm); background: rgba(0,0,0,0.65); color: #fff; font-family: var(--font); font-size: 12px; font-weight: 500; cursor: pointer; transition: background 0.18s; display: flex; align-items: center; justify-content: center; }
.card-download { text-decoration: none; }
.card-download:hover, .card-regenerate:hover, .card-copy-prompt:hover { background: var(--accent); color: var(--bg); }
.card-animate-featured { padding: 6px 12px; border: none; border-radius: var(--radius-sm); background: rgba(0,0,0,0.65); color: var(--accent-sage); font-family: var(--font); font-size: 12px; font-weight: 500; cursor: pointer; transition: background 0.18s; display: flex; align-items: center; justify-content: center; }
.card-animate-featured:hover { background: var(--accent-sage); color: var(--bg); }
.card-recreate-primary { background: rgba(255,46,136,0.86); color: var(--bg); font-weight: 700; }
.card-recreate-primary:hover { background: var(--accent-hover); }
.card-hardcore-unlock { background: linear-gradient(135deg, rgba(255,46,136,0.92), rgba(124,255,216,0.88)); color: var(--bg); font-weight: 800; box-shadow: 0 0 18px rgba(255,46,136,0.28); }
.card-hardcore-unlock:hover { background: var(--accent-sage); color: var(--bg); }
.card-regenerate:disabled { opacity: 0.5; cursor: not-allowed; }
.card-delete { position: absolute; top: 8px; right: 8px; z-index: 5; width: 28px; height: 28px; border: none; border-radius: 50%; background: rgba(0,0,0,0.65); color: #fff; font-size: 16px; cursor: pointer; opacity: 0; transition: opacity 0.2s, background 0.18s; display: flex; align-items: center; justify-content: center; }
.gallery-card:hover .card-delete { opacity: 1; }
.card-delete:hover { background: var(--danger); }
.card-favourite { position: absolute; inset: 0; z-index: 1; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.2s; pointer-events: none; }
.gallery-card:hover .card-favourite { opacity: 1; }
.card-favourite-btn { width: 52px; height: 52px; border: none; border-radius: 50%; background: rgba(0,0,0,0.45); color: rgba(255,255,255,0.85); font-size: 26px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.2s, color 0.2s; pointer-events: auto; line-height: 1; }
.card-favourite.is-favourite .card-favourite-btn { color: #FF2E88; }
.gallery-card.favourite-card .card-favourite { opacity: 1; }
.gallery-card.favourite-card .card-favourite .card-favourite-btn { color: #FF2E88; }
.gallery-card.favourite-card .card-delete { display: none; }

[hidden] { display: none !important; }

/* ── Lightbox ──────────────────────────────────────────────────────────────── */
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,0.94); display: flex; align-items: center; justify-content: center; padding: 20px; animation: fadeIn 0.18s; }
.lightbox[hidden] { display: none !important; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.lightbox-content { position: relative; max-width: 94vw; max-height: 94vh; display: flex; flex-direction: column; align-items: center; }
.lightbox-media { position: relative; display: flex; align-items: center; justify-content: center; max-width: 100%; }
.lightbox-img { max-width: 100%; max-height: 86vh; border-radius: var(--radius); box-shadow: 0 20px 60px rgba(0,0,0,0.6); display: block; }
.lightbox-close { position: absolute; top: -40px; right: 0; width: 36px; height: 36px; border: none; border-radius: 50%; background: rgba(255,255,255,0.08); color: #fff; font-size: 24px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.18s; z-index: 7; }
.lightbox-close:hover { background: rgba(255,255,255,0.18); }
/* Fullscreen toggle — bottom-right corner of the video only */
.lightbox-fs { position: absolute; bottom: 12px; right: 12px; width: 40px; height: 40px; border: 1px solid rgba(255,255,255,0.22); border-radius: 50%; background: rgba(15,16,20,0.6); color: #fff; font-size: 17px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.18s; z-index: 8; backdrop-filter: blur(4px); }
.lightbox-fs:hover { background: rgba(255,46,136,0.55); }
/* Pager arrows — outside the image, at the overlay edges */
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 7; width: 46px; height: 46px; border-radius: 50%; background: rgba(15,16,20,0.55); border: 1px solid rgba(255,255,255,0.18); color: #fff; font-size: 24px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.18s; backdrop-filter: blur(4px); }
.lightbox-nav:hover { background: rgba(255,46,136,0.55); }
.lightbox-nav-l { left: 20px; }
.lightbox-nav-r { right: 20px; }
.lightbox-actions { margin-top: 12px; display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.lightbox-download { padding: 8px 16px; border: none; border-radius: var(--radius-sm); background: var(--accent); color: var(--bg); font-family: var(--font); font-size: 13px; font-weight: 700; text-decoration: none; cursor: pointer; transition: background 0.18s; }
.lightbox-download:hover { background: var(--accent-hover); }
.lightbox-copy-prompt, .lightbox-regenerate { padding: 8px 16px; border-radius: var(--radius-sm); background: var(--bg-input); border: 1px solid var(--border); color: var(--text); font-family: var(--font); font-size: 13px; font-weight: 500; cursor: pointer; transition: background 0.18s, border-color 0.18s; }
.lightbox-copy-prompt:hover, .lightbox-regenerate:hover { background: var(--accent-glow); border-color: var(--accent); }
.lightbox-favourite { padding: 8px 16px; border-radius: var(--radius-sm); background: var(--bg-input); border: 1px solid var(--border); color: var(--text); font-family: var(--font); font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.18s; }
.lightbox-favourite:hover { border-color: #FF2E88; color: #FF2E88; }
.lightbox-favourite.is-favourite { color: #FF2E88; border-color: #FF2E88; background: rgba(255,46,136,0.12); }
.lightbox-delete { padding: 8px 16px; border-radius: var(--radius-sm); background: var(--bg-input); border: 1px solid var(--border); color: var(--text-dim); font-family: var(--font); font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.18s; }
.lightbox-delete:hover { border-color: var(--danger); color: var(--danger); }
.lightbox-info { margin-top: 14px; padding: 12px 18px; background: var(--bg-card); border-radius: var(--radius-sm); font-size: 13px; color: var(--text-dim); max-width: 600px; width: 100%; line-height: 1.6; }
.lightbox-info strong { color: var(--text); }
.lightbox-info:empty { display: none; }
.lightbox-animate { padding: 8px 16px; border-radius: var(--radius-sm); background: var(--accent); border: none; color: var(--bg); font-family: var(--font); font-size: 13px; font-weight: 700; cursor: pointer; transition: background 0.18s, transform 0.15s; }
.lightbox-animate:hover { background: var(--accent-hover); transform: translateY(-1px); }
.lightbox-animate:active { transform: none; }
/* unified action colors: Recreate/Regenerate = mint (Standard), Animate = pink (Pro), rest neutral */
.lightbox-regenerate { background: var(--accent-sage); border: none; color: #050607; font-weight: 700; }
.lightbox-regenerate:hover { background: var(--accent-sage); border: none; filter: brightness(1.08); }
.lightbox-animate { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.lightbox-animate svg { display: block; flex-shrink: 0; }
.lightbox-download { background: var(--bg-input); border: 1px solid var(--border); color: var(--text); font-weight: 600; }
.lightbox-download:hover { background: var(--accent-glow); border-color: var(--accent); }

/* ── Builder ───────────────────────────────────────────────────────────────── */
.builder-questionnaire { display: flex; flex-direction: column; gap: 12px; }
.builder-head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.builder-step-kicker { display: block; margin-bottom: 4px; font-size: 10px; font-weight: 700; color: var(--accent); letter-spacing: 0.08em; text-transform: uppercase; }
.builder-step-title { margin: 0; font-size: 17px; color: var(--text); }
.builder-step-description { margin: 4px 0 0; color: var(--text-dim); font-size: 13px; line-height: 1.4; }
.builder-nav { display: flex; justify-content: center; gap: 10px; flex-shrink: 0; }
.builder-nav-btn {
    min-width: 120px; padding: 10px 18px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--bg-input); color: var(--text-dim); font-family: var(--font);
    font-size: 14px; font-weight: 700; cursor: pointer; transition: all 0.15s;
}
.builder-nav-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--text); }
.builder-nav-btn:disabled { opacity: 0.35; cursor: default; }
.builder-step-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.builder-step-tabs::-webkit-scrollbar { display: none; }
.builder-step-tab {
    flex: 0 0 auto;
    min-width: 118px;
    padding: 7px 9px; border: 1px solid var(--border); border-radius: 10px;
    background: rgba(255,255,255,0.02); color: var(--text-muted);
    font-family: var(--font); font-size: 12px; line-height: 1.25;
    display: flex; align-items: center; justify-content: flex-start; gap: 6px;
    cursor: pointer; transition: all 0.15s;
}
.builder-step-num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 18px; height: 18px; flex: 0 0 18px; border-radius: 50%;
    background: rgba(255,255,255,0.06); color: var(--text-muted);
    font-size: 10px; font-weight: 700;
}
.builder-step-tab:hover { color: var(--text); border-color: rgba(255,46,136,0.35); }
.builder-step-tab.active { color: var(--text); border-color: var(--accent); background: var(--accent-glow); }
.builder-step-tab.complete { color: var(--success); border-color: rgba(77,184,112,0.58); background: rgba(77,184,112,0.09); }
.builder-step-tab.active.complete { color: var(--text); border-color: var(--success); box-shadow: 0 0 0 2px rgba(77,184,112,0.12); }
.builder-step-tab.complete .builder-step-num { background: rgba(77,184,112,0.16); color: var(--success); }
.builder-step-tab.active .builder-step-num { background: var(--accent); color: var(--bg); }
.builder-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.builder-option-card {
    border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-input);
    color: var(--text); padding: 0; overflow: hidden; cursor: pointer; text-align: left;
    font-family: var(--font); transition: transform 0.16s, border-color 0.16s, box-shadow 0.16s;
}
.builder-option-card:hover { transform: translateY(-1px); border-color: rgba(255,46,136,0.55); }
.builder-option-card.selected { border-color: var(--success); box-shadow: 0 0 0 2px rgba(77,184,112,0.12), 0 0 18px rgba(77,184,112,0.16); }
.builder-option-card img { width: 100%; aspect-ratio: 4/5; object-fit: cover; display: block; }
.builder-option-card.has-cover .builder-card-mock { display: none; }
.builder-option-card.has-cover.image-missing .builder-card-mock { display: flex; }
.builder-option-card.has-cover.image-missing img { display: none; }
.builder-card-mock {
    aspect-ratio: 4/5; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px;
    padding: 12px; background:
        radial-gradient(circle at top left, rgba(255,46,136,0.33), transparent 42%),
        radial-gradient(circle at bottom right, rgba(124,255,216,0.18), transparent 45%),
        linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.01));
}
.builder-card-mock span { color: var(--text-muted); font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.builder-card-mock strong { color: var(--text); font-size: 19px; line-height: 1.15; }
.builder-option-title { display: block; padding: 10px 12px 2px; font-size: 14px; font-weight: 700; }
.builder-option-meta { display: block; padding: 0 12px 12px; color: var(--text-muted); font-size: 11px; }
.builder-state-panel {
    display: grid; grid-template-columns: minmax(180px, 0.8fr) minmax(240px, 1.2fr); gap: 10px;
    padding: 10px; border: 1px solid var(--border); border-radius: var(--radius);
    background: rgba(255,255,255,0.02);
}
.builder-state-panel > div { min-width: 0; }
.builder-state-label { display: block; margin-bottom: 6px; color: var(--text-muted); font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.builder-selection-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 5px; }
.builder-selection-summary span {
    min-width: 0; padding: 5px 7px; border: 1px solid var(--border); border-radius: 8px;
    background: var(--bg-input); color: var(--text-dim); font-size: 11px; line-height: 1.35;
    overflow-wrap: anywhere;
}
.builder-selection-summary span:not(.builder-empty-selection) { border-color: rgba(77,184,112,0.32); }
.builder-selection-summary strong { color: var(--text); font-weight: 600; }
.builder-prompt-preview {
    color: var(--text-dim); font-size: 12px; line-height: 1.45;
    max-height: 74px; overflow-y: auto;
}
.builder-additional { margin-top: 12px; }
.negative-prompt-wrap { margin-top: 8px; }
.negative-prompt-toggle { background: none; border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-dim); font-size: 13px; padding: 4px 10px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; transition: border-color 0.15s, color 0.15s; }
.negative-prompt-toggle:hover { border-color: var(--accent); color: var(--accent); }
.negative-prompt-toggle[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
.negative-prompt-toggle-icon { font-size: 15px; line-height: 1; font-weight: 600; }
.negative-prompt-panel { margin-top: 6px; }

/* ── Auth screen ───────────────────────────────────────────────────────────── */
.auth-loading {
    min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 20px;
    background:
        radial-gradient(ellipse 100% 55% at 50% 0%, rgba(255,46,136,0.09) 0%, transparent 65%),
        var(--bg);
}
.auth-loading-card {
    width: 100%; max-width: 320px;
    display: flex; flex-direction: column; align-items: center; gap: 18px;
    color: var(--text-dim); text-align: center;
}
.auth-loading-logo { width: 92px; height: auto; display: block; }
.auth-loading-spinner {
    width: 32px; height: 32px;
    border: 2px solid rgba(255,255,255,0.12);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
    box-shadow: 0 0 18px rgba(255,46,136,0.2);
}
.auth-loading-card p { font-size: 13px; letter-spacing: 0.02em; }

.auth-screen {
    min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 20px;
    background:
        radial-gradient(ellipse 100% 55% at 50% 0%, rgba(255,46,136,0.09) 0%, transparent 65%),
        var(--bg);
}
.auth-card {
    position: relative;
    width: 100%; max-width: 400px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 32px 28px 28px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.55);
    display: flex; flex-direction: column; gap: 18px;
}
.auth-header { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.auth-back-btn { position: absolute; top: -44px; right: 0; width: 36px; height: 36px; border: none; border-radius: 50%; background: rgba(255,255,255,0.08); color: #fff; font-size: 24px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.18s; text-decoration: none; }
.auth-back-btn:hover { background: rgba(255,255,255,0.18); }
.auth-subtitle { color: var(--text-dim); font-size: 13px; line-height: 1.55; margin-top: -4px; }
.auth-tabs { display: flex; gap: 4px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 4px; }
.auth-tab { flex: 1; padding: 8px 12px; border: none; border-radius: calc(var(--radius-sm) - 2px); background: transparent; color: var(--text-dim); font-family: var(--font); font-size: 14px; font-weight: 500; cursor: pointer; transition: background 0.18s, color 0.18s; }
.auth-tab:hover { color: var(--text); }
.auth-tab.active { background: var(--bg-card); color: var(--text); font-weight: 600; box-shadow: 0 1px 4px rgba(0,0,0,0.3); }
.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-input { width: 100%; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); font-family: var(--font); font-size: 15px; padding: 11px 14px; transition: border-color 0.18s, box-shadow 0.18s; }
.auth-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.auth-error { font-size: 13px; color: var(--danger); background: rgba(217,80,64,0.07); border: 1px solid rgba(217,80,64,0.28); border-radius: var(--radius-sm); padding: 9px 12px; }
.auth-message { font-size: 13px; color: var(--success); background: rgba(77,184,112,0.07); border: 1px solid rgba(77,184,112,0.28); border-radius: var(--radius-sm); padding: 9px 12px; text-align: center; }
.auth-submit-btn { width: 100%; padding: 12px; border: none; border-radius: var(--radius-sm); background: var(--accent); color: var(--bg); font-family: var(--font); font-size: 15px; font-weight: 700; cursor: pointer; transition: background 0.18s, transform 0.15s, box-shadow 0.18s; margin-top: 4px; }
.auth-submit-btn:hover:not(:disabled) { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 4px 16px var(--accent-glow); }
.auth-submit-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.auth-divider { display: flex; align-items: center; gap: 10px; margin: 4px 0; color: var(--text-muted); font-size: 12px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-google-btn { width: 100%; padding: 11px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: transparent; color: var(--text); font-family: var(--font); font-size: 14px; font-weight: 500; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; transition: background 0.15s, border-color 0.15s; }
.auth-google-btn:hover { background: var(--bg-hover); border-color: var(--text-muted); }
.auth-legacy-link { align-self: center; color: var(--text-muted); font-size: 12px; text-decoration: none; transition: color 0.15s; }
.auth-legacy-link:hover { color: var(--accent); }

/* ── Sidebar user ──────────────────────────────────────────────────────────── */
.sidebar-user { display: none; flex-direction: column; gap: 8px; }
.sidebar-user-info { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sidebar-user-email { font-size: 12px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.sidebar-user-credits { font-size: 11px; color: var(--text-dim); line-height: 1.6; padding: 8px 10px; background: var(--bg-input); border-radius: var(--radius-sm); display: flex; flex-direction: column; gap: 6px; }
.sidebar-user-credits strong { color: var(--text); }
.sidebar-upgrade-section { display: grid; grid-template-columns: 1fr; gap: 6px; }
.sidebar-upgrade-btn { width: 100%; padding: 8px 10px; border: 1px solid rgba(255,46,136,0.35); border-radius: var(--radius-sm); background: var(--accent-glow); color: var(--text); font-family: var(--font); font-size: 12px; font-weight: 700; cursor: pointer; transition: background 0.18s, border-color 0.18s, transform 0.15s; }
.sidebar-upgrade-btn:hover:not(:disabled) { border-color: var(--accent); background: rgba(255,46,136,0.2); transform: translateY(-1px); }
.sidebar-upgrade-pro { border-color: rgba(124,255,216,0.32); background: var(--mint-dim); }
.sidebar-upgrade-pro:hover:not(:disabled) { border-color: var(--mint); background: rgba(124,255,216,0.24); }
.sidebar-upgrade-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.usage-row { display: flex; flex-direction: column; gap: 3px; }
.usage-label { display: flex; justify-content: space-between; font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; }
.usage-label strong { color: var(--text-dim); }
.usage-bar { height: 3px; border-radius: 99px; background: rgba(255,255,255,0.07); overflow: hidden; }
.usage-bar-fill { height: 100%; border-radius: 99px; transition: width 0.4s; }
.usage-bar-fill.image { background: linear-gradient(90deg, #FF2E88, #FF8AC8); }
.usage-bar-fill.video { background: linear-gradient(90deg, #7CFFD8, #FF4FB3); }
.sidebar-logout-btn { width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: transparent; color: var(--text-dim); font-family: var(--font); font-size: 13px; font-weight: 500; cursor: pointer; transition: background 0.18s, color 0.18s, border-color 0.18s; text-align: center; }
.sidebar-logout-btn:hover { background: rgba(217,80,64,0.07); border-color: rgba(217,80,64,0.35); color: var(--danger); }
/* account person lives in the top bar (right side) on all screens */
.sidebar-account-toggle { display: none; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; background: var(--bg-input); border: 1px solid var(--border); color: var(--text); cursor: pointer; flex-shrink: 0; padding: 0; }
.sidebar-account-toggle:not([hidden]) { display: flex; }
.sidebar-account-toggle:hover { border-color: var(--accent); color: var(--text); }
.sidebar-getmore-btn { width: 100%; padding: 10px 12px; border: none; border-radius: var(--radius-sm); background: var(--gradient-cta); color: #050607; font-family: var(--font); font-size: 13px; font-weight: 700; cursor: pointer; transition: filter 0.18s, transform 0.15s; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.sidebar-getmore-btn svg, .lightbox-favourite svg { display: block; flex-shrink: 0; }
.lightbox-favourite { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.sidebar-getmore-btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
/* "Get more" pill in the top bar (free only) */
.free-upgrade-fab { display: none; align-items: center; gap: 6px; padding: 7px 13px; border: none; border-radius: 99px; background: var(--gradient-cta); color: #050607; font-family: var(--font); font-size: 12px; font-weight: 700; cursor: pointer; flex-shrink: 0; }
.free-upgrade-fab.show { display: inline-flex; }
.free-upgrade-fab svg { display: block; flex-shrink: 0; }
.account-close { display: none; }
.account-backdrop { display: none; }
.account-backdrop.open { display: block; }
/* account drawer slides in from the right (all screens) */
.sidebar-user.account-open {
    display: flex; position: fixed; top: 0; right: 0; bottom: 0; width: min(88%, 320px); z-index: 202;
    margin: 0; padding: 60px 18px 24px; border: none; border-left: 1px solid var(--border);
    background: linear-gradient(180deg, #0b0c0e 0%, #050607 100%);
    box-shadow: 0 0 60px rgba(0,0,0,0.7); overflow-y: auto; animation: drawerIn 0.22s ease;
}
.sidebar-user.account-open .account-close {
    display: flex; align-items: center; justify-content: center; position: absolute; top: 12px; right: 12px;
    width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border); background: var(--bg-input);
    color: var(--text); font-size: 20px; cursor: pointer;
}
@keyframes drawerIn { from { transform: translateX(100%); } to { transform: translateX(0); } }

/* ── Plan badges ───────────────────────────────────────────────────────────── */
.plan-badge { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 20px; text-transform: uppercase; letter-spacing: 0.4px; white-space: nowrap; flex-shrink: 0; }
.plan-badge.plan-free { background: rgba(124,255,216,0.1); color: var(--accent-sage); border: 1px solid rgba(124,255,216,0.25); }
.plan-badge.plan-basic { background: rgba(255,138,200,0.1); color: var(--accent-nude); border: 1px solid rgba(255,138,200,0.25); }
.plan-badge.plan-pro { background: var(--accent-glow); color: var(--accent); border: 1px solid rgba(255,46,136,0.35); }

/* ── Modals (animate, limit) ───────────────────────────────────────────────── */
.animate-modal { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fadeIn 0.18s; }
.animate-modal[hidden] { display: none !important; }
.animate-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.88); }
.animate-modal-content { position: relative; z-index: 1; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px 24px 24px; width: 100%; max-width: 620px; box-shadow: 0 24px 60px rgba(0,0,0,0.6); }
.animate-modal-close { position: absolute; top: 12px; right: 14px; width: 30px; height: 30px; border: none; border-radius: 50%; background: rgba(255,255,255,0.06); color: var(--text-dim); font-size: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.18s, color 0.18s; }
.animate-modal-close:hover { background: rgba(255,255,255,0.13); color: var(--text); }
.animate-modal-title { font-size: 18px; font-weight: 700; margin-bottom: 4px; color: var(--text); }
.animate-modal-subtitle { font-size: 13px; color: var(--text-dim); margin-bottom: 16px; }
.animate-prompt-tabs { display: flex; gap: 4px; margin-bottom: 12px; }
.animate-prompt-panel { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
#animate-source-prompt[readonly] { color: var(--text-dim); min-height: 64px; }
.animate-lora-header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 4px 0 8px; }
.animate-lora-header .control-label { margin-bottom: 0; }
.animate-lora-help { font-size: 11px; color: var(--text-dim); line-height: 1.4; text-align: right; }
.animate-lora-list { display: flex; flex-direction: column; gap: 10px; max-height: 300px; overflow-y: auto; margin-bottom: 20px; padding-right: 4px; }
.video-lora-row { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-input); padding: 12px; }
.video-lora-main { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.video-lora-main input { margin-top: 3px; accent-color: var(--accent); }
.video-lora-main strong { display: block; font-size: 14px; color: var(--text); }
.video-lora-main small { display: block; margin-top: 2px; font-size: 12px; color: var(--text-dim); }
.video-lora-hint { margin: 8px 0 0 24px; font-size: 12px; color: var(--text-dim); line-height: 1.4; }
.video-lora-scale { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding-left: 24px; }
.video-lora-slider { flex: 1; accent-color: var(--accent); cursor: pointer; }
.video-lora-slider:disabled { opacity: 0.4; cursor: not-allowed; }
.animate-preset-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 20px; }
.animate-preset-btn { padding: 14px 10px; border: 2px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-input); color: var(--text); font-family: var(--font); font-size: 14px; font-weight: 600; cursor: pointer; transition: border-color 0.18s, background 0.18s; text-align: center; }
.animate-preset-btn:hover { border-color: var(--accent); background: var(--bg-hover); }
.animate-preset-btn.active { border-color: var(--accent); background: var(--bg-hover); color: var(--accent); }
.animate-modal-actions { display: flex; gap: 10px; }
.animate-submit-btn { flex: 1; padding: 10px 20px; border: none; border-radius: var(--radius-sm); background: var(--accent); color: var(--bg); font-family: var(--font); font-size: 14px; font-weight: 700; cursor: pointer; transition: background 0.18s, opacity 0.18s; }
.animate-submit-btn:hover:not(:disabled) { background: var(--accent-hover); }
.animate-submit-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.animate-cancel-btn { padding: 10px 18px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-input); color: var(--text-dim); font-family: var(--font); font-size: 14px; font-weight: 500; cursor: pointer; transition: background 0.18s, color 0.18s; }
.animate-cancel-btn:hover { background: var(--bg); color: var(--text); }
.animate-progress-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 32px 0; }
.animate-progress-pulse { width: 56px; height: 56px; border-radius: 50%; background: var(--accent-glow); animation: animatePulse 1.4s ease-in-out infinite; }
@keyframes animatePulse {
    0%, 100% { transform: scale(1);   opacity: 0.8; box-shadow: 0 0 0 0   rgba(255,46,136,0.4); }
    50%       { transform: scale(1.2); opacity: 1;   box-shadow: 0 0 0 16px rgba(255,46,136,0); }
}
.animate-progress-label { font-size: 15px; font-weight: 600; color: var(--text); }
.animate-progress-timer { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent); line-height: 1; }
.animate-video { width: 100%; border-radius: var(--radius-sm); background: #000; display: block; margin-bottom: 16px; max-height: 50vh; }
.animate-result-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.animate-download-btn { padding: 10px 22px; border: none; border-radius: var(--radius-sm); background: var(--accent); color: var(--bg); font-family: var(--font); font-size: 14px; font-weight: 700; text-decoration: none; cursor: pointer; transition: background 0.18s; }
.animate-download-btn:hover { background: var(--accent-hover); }
.limit-modal { position: fixed; inset: 0; z-index: 400; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fadeIn 0.18s; }
.limit-modal[hidden] { display: none !important; }
.limit-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.92); }
.limit-modal-content { position: relative; z-index: 1; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px 24px 20px; width: 100%; max-width: 400px; box-shadow: 0 24px 60px rgba(0,0,0,0.6); }
.limit-modal-title { font-size: 20px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.limit-modal-msg { font-size: 14px; color: var(--text-dim); line-height: 1.7; margin-bottom: 20px; }
.limit-modal-msg strong { color: var(--text); }
.limit-modal-actions { display: flex; justify-content: flex-end; }
/* ── Upgrade modal ─────────────────────────────────────────────────────────── */
.upgrade-modal-content { max-width: 700px; }
@media (max-width: 700px) {
    .limit-modal .upgrade-modal-content { max-width: 400px; max-height: 88vh; overflow-y: auto; padding: 22px 16px 16px; }
    .limit-modal .upgrade-tiers { grid-template-columns: 1fr; gap: 10px; }
    .limit-modal .upgrade-tier-pro  { order: 1; }
    .limit-modal .upgrade-tier-std  { order: 2; }
    .limit-modal .upgrade-tier-free { order: 3; }
}
.upgrade-modal-header { text-align: center; margin-bottom: 20px; }
.upgrade-modal-icon { font-size: 28px; margin-bottom: 8px; }
.upgrade-context { font-size: 13px; color: var(--text-dim); line-height: 1.6; margin-top: 6px; }
.upgrade-tiers { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr) minmax(0,1fr); gap: 10px; margin-bottom: 16px; }
.upgrade-tier { background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 12px; display: flex; flex-direction: column; gap: 8px; position: relative; }
.upgrade-tier-free { border-color: rgba(255,255,255,0.08); }
.upgrade-tier-std { border-color: rgba(124,255,216,0.3); background: rgba(124,255,216,0.03); }
.upgrade-tier-pro { border-color: rgba(255,46,136,0.6); background: rgba(255,46,136,0.06); box-shadow: 0 0 24px rgba(255,46,136,0.14); }
.upgrade-tier-badge { font-size: 9px; font-weight: 700; padding: 2px 8px; border-radius: 99px; display: inline-block; width: fit-content; text-transform: uppercase; letter-spacing: 0.5px; }
.upgrade-tier-badge.popular { background: rgba(255,46,136,0.18); color: var(--accent); border: 1px solid rgba(255,46,136,0.35); }
.upgrade-tier-badge-std { font-size: 9px; font-weight: 700; padding: 2px 8px; border-radius: 99px; display: inline-block; width: fit-content; text-transform: uppercase; letter-spacing: 0.5px; background: rgba(124,255,216,0.12); color: var(--accent-sage); border: 1px solid rgba(124,255,216,0.3); }
.upgrade-tier-name { font-size: 14px; font-weight: 700; color: var(--text); }
.upgrade-tier-price { font-size: 24px; font-weight: 800; color: var(--text); line-height: 1; }
.upgrade-tier-price-free { color: var(--accent-sage); font-size: 24px; font-weight: 800; line-height: 1; }
.upgrade-tier-price span { font-size: 11px; font-weight: 400; color: var(--text-dim); }
.upgrade-feats { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.upgrade-feats li { font-size: 11px; color: var(--text-dim); padding-left: 14px; position: relative; }
.upgrade-feats li::before { content: "✓"; position: absolute; left: 0; color: var(--accent-sage); font-size: 11px; }
.upgrade-feats li.feat-no { color: var(--text-muted); }
.upgrade-feats li.feat-no::before { content: "✗"; color: var(--text-muted); }
.upgrade-btn { width: 100%; padding: 9px; border: none; border-radius: var(--radius-sm); font-family: var(--font); font-size: 12px; font-weight: 700; cursor: pointer; transition: all 0.18s; margin-top: 4px; }
.upgrade-btn-free { background: transparent; border: 0.5px solid var(--border); color: var(--text-muted); cursor: default; }
.upgrade-btn-primary { background: linear-gradient(135deg, rgba(124,255,216,0.9), var(--accent-sage)); color: #050607; box-shadow: 0 0 14px rgba(124,255,216,0.28); }
.upgrade-btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.upgrade-btn-pro { background: var(--gradient-cta); color: #050607; box-shadow: var(--glow-pink); }
.upgrade-btn-pro:hover { opacity: 0.9; transform: translateY(-1px); }
.upgrade-note { text-align: center; font-size: 11px; color: var(--text-muted); }

/* ── Age gate ──────────────────────────────────────────────────────────────── */
#age-gate { display: none; position: fixed; inset: 0; z-index: 9999; }
.age-gate-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.97); display: flex; align-items: center; justify-content: center; padding: 1rem; }
.age-gate-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 2.5rem 2rem; max-width: 440px; width: 100%; text-align: center; }
.age-gate-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.age-gate-card h2 { color: var(--text); font-size: 1.5rem; margin-bottom: 1rem; }
.age-gate-card p { color: var(--text-dim); margin-bottom: 0.75rem; line-height: 1.6; }
.age-gate-sub { font-size: 0.82rem !important; color: var(--text-muted) !important; }
.age-gate-buttons { display: flex; flex-direction: column; gap: 0.75rem; margin: 1.5rem 0 1rem; }
#age-enter-btn { background: var(--accent); color: var(--bg); border: none; padding: 0.9rem 1.5rem; border-radius: 8px; font-size: 1rem; font-weight: 700; cursor: pointer; transition: background 0.18s; }
#age-enter-btn:hover { background: var(--accent-hover); }
#age-leave-btn { background: transparent; color: var(--text-muted); border: 1px solid var(--border); padding: 0.75rem; border-radius: 8px; cursor: pointer; transition: color 0.18s; font-family: var(--font); }
#age-leave-btn:hover { color: var(--text-dim); }
.age-gate-links { display: flex; gap: 1.5rem; justify-content: center; margin-top: 0.5rem; }
.age-gate-links a { color: var(--text-muted); font-size: 0.8rem; text-decoration: none; }
.age-gate-links a:hover { color: var(--accent); }

/* ── Footer ────────────────────────────────────────────────────────────────── */
.site-footer { background: #050607; border-top: 1px solid var(--border); padding: 1.25rem 2rem; display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; font-size: 0.78rem; color: var(--text-muted); }
.footer-left { display: flex; flex-direction: column; gap: 0.25rem; }
.footer-nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.site-footer a { color: var(--text-muted); text-decoration: none; transition: color 0.18s; }
.site-footer a:hover { color: var(--accent); }

/* ── Public showcase ───────────────────────────────────────────────────────── */
#public-showcase {
    min-height: 100dvh; display: flex; flex-direction: column;
    background:
        radial-gradient(ellipse 80% 40% at 50% -5%, rgba(255,46,136,0.08) 0%, transparent 65%),
        var(--bg);
}
.showcase-header {
    position: sticky; top: 0; z-index: 50;
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 28px;
    background: rgba(5,6,7,0.88);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.showcase-brand { display: flex; align-items: center; gap: 10px; }
.showcase-header-nav { display: flex; align-items: center; gap: 10px; }
.showcase-login-btn {
    padding: 8px 18px; border: 1px solid var(--border);
    border-radius: var(--radius-sm); background: transparent;
    color: var(--text-dim); font-family: var(--font); font-size: 14px;
    font-weight: 500; cursor: pointer; transition: all 0.18s;
}
.showcase-login-btn:hover { border-color: var(--text-dim); color: var(--text); }
.showcase-register-btn {
    padding: 8px 20px; border: none;
    border-radius: var(--radius-sm); background: var(--accent);
    color: var(--bg); font-family: var(--font); font-size: 14px;
    font-weight: 700; cursor: pointer; transition: background 0.18s;
}
.showcase-register-btn:hover { background: var(--accent-hover); }
.showcase-hero {
    max-width: 640px; margin: 0 auto;
    padding: 60px 28px 48px;
    text-align: center;
}
.showcase-eyebrow {
    display: inline-block; font-size: 12px; font-weight: 600;
    color: var(--accent); letter-spacing: 0.08em; text-transform: uppercase;
    margin-bottom: 16px;
}
.showcase-headline {
    font-family: var(--font-display); font-size: clamp(2.2rem, 5vw, 3.6rem);
    font-weight: 600; line-height: 1.08; letter-spacing: 0.01em;
    color: var(--text); margin-bottom: 16px;
}
.showcase-sub { font-size: 1.05rem; color: var(--text-dim); margin-bottom: 28px; line-height: 1.6; }
.showcase-cta {
    display: inline-block; padding: 13px 32px;
    border: none; border-radius: var(--radius-sm);
    background: var(--accent); color: var(--bg);
    font-family: var(--font); font-size: 15px; font-weight: 700;
    cursor: pointer; transition: background 0.18s, transform 0.15s, box-shadow 0.18s;
}
.showcase-cta:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 6px 24px var(--accent-glow); }
.showcase-gallery { flex: 1; padding: 8px 28px 40px; max-width: 1400px; width: 100%; margin: 0 auto; }
.showcase-gallery .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.showcase-banner {
    text-align: center; padding: 40px 28px;
    border-top: 1px solid var(--border);
    background: linear-gradient(0deg, rgba(255,46,136,0.05) 0%, transparent 100%);
}
.showcase-banner p { color: var(--text-dim); font-size: 1rem; margin-bottom: 16px; }
.showcase-banner-cta {
    display: inline-block; padding: 12px 28px;
    border: 1px solid var(--accent); border-radius: var(--radius-sm);
    background: transparent; color: var(--accent);
    font-family: var(--font); font-size: 15px; font-weight: 600;
    cursor: pointer; transition: background 0.18s, color 0.18s;
}
.showcase-banner-cta:hover { background: var(--accent); color: var(--bg); }
.showcase-footer { padding: 20px 28px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: 0.8rem; color: var(--text-muted); }
.showcase-footer a { color: var(--text-muted); text-decoration: none; transition: color 0.15s; }
.showcase-footer a:hover { color: var(--accent); }
.showcase-footer nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.showcase-create-btn { padding: 10px 24px; border: none; border-radius: var(--radius-sm); background: var(--accent); color: var(--bg); font-family: var(--font); font-size: 14px; font-weight: 700; cursor: pointer; transition: background 0.18s; }
.showcase-create-btn:hover { background: var(--accent-hover); }

/* ── Mobile ────────────────────────────────────────────────────────────────── */
@media (max-width: 700px) {
    /* mobile keeps the convenient BOTTOM nav bar (the top bar is desktop-only) */
    .sidebar { position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; flex-direction: row; align-items: center; padding: 8px 8px; gap: 5px; border-bottom: none; border-top: 1px solid var(--border); z-index: 200; }
    .sidebar-logo { display: none; }
    .sidebar-brand-text { display: none; }
    .sidebar-nav { flex: 1; gap: 3px; margin-right: 0; overflow-x: auto; scrollbar-width: none; }
    .sidebar-nav::-webkit-scrollbar { display: none; }
    .sidebar-btn { flex: 1; font-size: 11.5px; padding: 8px 6px; white-space: nowrap; }
    .sidebar-account-toggle { display: none !important; }
    /* account = semi-transparent hamburger at the top of the content, scrolls away (not fixed) */
    .mobile-account-btn:not([hidden]) {
        display: flex; align-items: center; justify-content: center;
        position: absolute; top: 10px; left: 10px; z-index: 50;
        width: 36px; height: 36px; border-radius: 10px;
        background: rgba(18,20,24,0.22); border: 1px solid rgba(255,255,255,0.06);
        color: rgba(255,255,255,0.5); cursor: pointer; backdrop-filter: blur(5px);
    }
    .mobile-account-btn:active { background: rgba(18,20,24,0.55); color: rgba(255,255,255,0.85); }
    .main-content { margin-left: 0; margin-top: 0; padding-bottom: 66px; }
    /* Get more (free) floats just above the bottom bar — always on screen */
    .free-upgrade-fab { position: fixed; bottom: 72px; right: 12px; z-index: 199; box-shadow: 0 2px 12px rgba(0,0,0,0.5); }
    .generator-inner { grid-template-columns: 1fr; }
    .prompt-mode-tabs { width: 100%; }
    .tab-btn { flex: 1; }
    .generator-controls-bar { flex-wrap: wrap; }
    .generator-controls-bar .generate-btn { margin-left: 0; width: 100%; }
    .builder-head { flex-direction: column; }
    .builder-nav { width: 100%; }
    .builder-nav-btn { flex: 1; }
    .builder-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .builder-state-panel { grid-template-columns: 1fr; }
    /* compact result preview so it doesn't eat the whole mobile screen */
    .studio-result,
    .studio-result.result-portrait,
    .studio-result.result-square,
    .studio-result.result-wide { width: min(62%, 220px); }
    .studio-result-actions { width: min(62%, 220px); }
    .gallery-section { padding: 16px; }
    .content-tabs { margin-bottom: 12px; }
    .gallery-header { gap: 10px; }
    .gallery-per-page { margin-left: 0; }
    .featured-info-grid { grid-template-columns: 1fr; }
    .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .gallery-card img { aspect-ratio: 3/4; }
    /* image thumbnails: clean & tappable on mobile — actions live in the lightbox */
    /* image thumbnails on mobile: clean photo, quick ♥ + Regenerate, no prompt/tags */
    .gallery-card:not(.video-card) .card-overlay,
    .gallery-card:not(.video-card) .featured-card-chips,
    .gallery-card:not(.video-card) .card-delete,
    .gallery-card:not(.video-card) .card-actions .card-download,
    .gallery-card:not(.video-card) .card-actions .card-copy-prompt,
    .gallery-card:not(.video-card) .card-animate-featured { display: none; }
    .gallery-card:not(.video-card):active { transform: scale(0.98); }
    /* quick favourite — small heart, top-left, never covers the image */
    .gallery-card:not(.video-card) .card-favourite {
        inset: auto; top: 6px; left: 6px; opacity: 1; pointer-events: auto;
    }
    .gallery-card:not(.video-card) .card-favourite-btn {
        width: 34px; height: 34px; font-size: 18px; background: rgba(5,6,7,0.55);
    }
    /* Regenerate / Recreate — slim pill pinned to the bottom */
    .gallery-card:not(.video-card) .card-actions {
        opacity: 1; top: auto; bottom: 8px; left: 8px; right: 8px;
        transform: none; width: auto; max-width: none; gap: 6px;
    }
    .gallery-card:not(.video-card) .card-actions > * {
        flex: 1; min-width: 0; justify-content: center; text-align: center;
        font-size: 12px; padding: 8px 6px;
        white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    /* video cards keep on-card controls (no lightbox for video) */
    .video-card .card-overlay { opacity: 1; }
    .video-card .card-actions, .video-card .card-delete { opacity: 1; }
    /* lightbox tuned for phone screens */
    .lightbox { padding: 12px; }
    .lightbox-close { top: 6px; right: 6px; background: rgba(0,0,0,0.6); }
    .lightbox-fs { bottom: 10px; right: 10px; width: 36px; height: 36px; }
    .lightbox-img { max-height: 70vh; }
    .lightbox-nav { width: 38px; height: 38px; font-size: 20px; }
    .lightbox-nav-l { left: 8px; }
    .lightbox-nav-r { right: 8px; }
    .lightbox-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; max-width: 360px; }
    .lightbox-actions a, .lightbox-actions button { width: 100%; font-size: 12px; padding: 9px 8px; box-sizing: border-box; white-space: nowrap; display: flex; align-items: center; justify-content: center; gap: 6px; }
    .gallery-pagination { gap: 8px; }
    .pagination-btn { padding: 10px 14px; }
    .pagination-num { min-width: 32px; padding: 8px; }
    .animate-modal-content { max-height: 92dvh; overflow-y: auto; }
    .animate-lora-list { max-height: 260px; }
    .auth-card { padding: 24px 20px 20px; }
    .showcase-header { padding: 12px 16px; }
    .showcase-hero { padding: 40px 20px 32px; }
    .showcase-gallery { padding: 0 16px 32px; }
    .showcase-gallery .gallery-grid { grid-template-columns: repeat(2, 1fr); }
    .showcase-footer { flex-direction: column; align-items: flex-start; }
}

/* ── Studio result preview ──────────────────────────────────────────── */
.studio-result-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
}
.studio-result-card {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(255,255,255,0.025);
}
.studio-result-head {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.studio-result-kicker { font-size: 10px; font-weight: 800; color: var(--accent); letter-spacing: 0.12em; text-transform: uppercase; }
.studio-result-hint { color: var(--text-muted); font-size: 11px; text-align: right; }
.studio-result {
    width: min(100%, 260px);
    aspect-ratio: 3/4;
    background: rgba(255,46,136,0.04);
    border: 1px dashed rgba(255,46,136,0.35);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 0.2s, aspect-ratio 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.studio-result.result-portrait { width: min(100%, 280px); aspect-ratio: 3/4; }
.studio-result.result-square { width: min(100%, 300px); aspect-ratio: 1/1; }
.studio-result.result-wide { width: min(100%, 420px); aspect-ratio: 16/9; }
.studio-result.generating {
    border-color: var(--accent);
    animation: studio-pulse 1.5s ease-in-out infinite;
}
@keyframes studio-pulse {
    0%, 100% { box-shadow: 0 0 8px rgba(255,46,136,0.2); }
    50%       { box-shadow: 0 0 20px rgba(255,46,136,0.35); }
}
.studio-result img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}
.studio-result-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
}
.studio-result-placeholder span { font-size: 14px; opacity: 0.8; color: var(--accent); font-weight: 700; }
.studio-result-placeholder small { font-size: 10px; color: var(--text-muted); letter-spacing: 0.05em; text-transform: uppercase; }
.studio-timer {
    font-size: 10px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    color: var(--accent-sand);
    font-weight: 600;
    letter-spacing: 0.04em;
    min-height: 14px;
}
.studio-result-actions {
    display: flex;
    gap: 4px;
    width: 140px;
}
.studio-result-actions button {
    flex: 1;
    background: var(--bg-input);
    border: 0.5px solid var(--border);
    color: var(--text-dim);
    font-size: 9px;
    padding: 4px 2px;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all 0.15s;
    text-align: center;
}
.studio-result-actions button:hover { background: var(--bg-hover); color: var(--text); }
.studio-result-actions button:disabled { opacity: 0.4; cursor: default; }
.studio-animate-btn { color: var(--accent-sand) !important; border-color: rgba(183,255,232,0.2) !important; }

/* ── Recreate source badge ───────────────────────────────────────────── */
.recreate-source {
    display: none;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    color: var(--text-dim);
    background: rgba(255,46,136,0.06);
    border: 0.5px solid rgba(255,46,136,0.2);
    border-radius: 5px;
    padding: 4px 10px;
}
.recreate-source.visible { display: flex; }
.recreate-source-text { color: var(--text-muted); }
.recreate-source-label { color: var(--accent-sand); font-weight: 500; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recreate-source-clear {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 13px;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
}
.recreate-source-clear:hover { color: var(--text); }

/* ── Featured category chips (in app) ───────────────────────────────── */
.featured-cats {
    display: flex;
    gap: 6px;
    padding: 10px 0 6px;
    overflow-x: auto;
    scrollbar-width: none;
    flex-shrink: 0;
}
.featured-cats::-webkit-scrollbar { display: none; }
.featured-cat {
    background: var(--bg-input);
    border: 0.5px solid var(--border);
    color: var(--text-dim);
    font-size: 11px;
    padding: 5px 13px;
    border-radius: 20px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.15s;
    user-select: none;
    font-family: 'Inter', sans-serif;
}
.featured-cat.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-weight: 500;
}
.featured-cat:hover:not(.active) { background: var(--bg-hover); color: var(--text); }
.featured-cat-hardcore {
    border-color: rgba(255,46,136,0.42);
    color: var(--accent-sand);
    background:
        linear-gradient(135deg, rgba(255,46,136,0.16), rgba(124,255,216,0.05)),
        var(--bg-input);
}
.featured-cat-hardcore.active {
    background: linear-gradient(135deg, #FF2E88, #8d174d);
    border-color: rgba(255,46,136,0.9);
    box-shadow: 0 0 18px rgba(255,46,136,0.28);
}
.featured-subcats {
    padding-top: 0;
    margin-top: -2px;
}
.featured-subcats .featured-cat {
    font-size: 10px;
    padding: 4px 11px;
    border-color: rgba(255,255,255,0.07);
    background: rgba(255,255,255,0.035);
}
.featured-subcats .featured-cat.active {
    background: rgba(124,255,216,0.14);
    border-color: rgba(124,255,216,0.44);
    color: var(--accent-sage);
    box-shadow: inset 0 0 0 1px rgba(124,255,216,0.08);
}

/* ── Featured card stats ─────────────────────────────────────────────── */
.card-stat { font-size: 11px; color: rgba(255,244,248,0.85); background: rgba(0,0,0,0.45); padding: 2px 7px; border-radius: 10px; }
.card-badge-hardcore {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    padding: 3px 8px;
    border: 1px solid rgba(255,46,136,0.34);
    border-radius: 999px;
    background: rgba(5,6,7,0.62);
    color: var(--accent-sand);
    box-shadow: 0 0 16px rgba(255,46,136,0.18);
    font-size: 11px;
    font-weight: 600;
}
.featured-card-chips {
    position: absolute; top: 8px; left: 8px; right: 8px; z-index: 4;
    display: flex; flex-wrap: wrap; gap: 4px; pointer-events: none;
}
.featured-recipe-chip {
    max-width: 100%; padding: 3px 7px; border-radius: 999px;
    background: rgba(0,0,0,0.56); border: 0.5px solid rgba(255,255,255,0.16);
    color: rgba(255,244,248,0.78); font-size: 9px; font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    backdrop-filter: blur(6px);
}

/* ── Studio gen overlay (circular timer inside result box) ───────────── */
.studio-gen-overlay {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 8px; z-index: 2;
}
.studio-gen-ring {
    width: 42px; height: 42px;
    border-radius: 50%;
    border: 2.5px solid rgba(255,46,136,0.18);
    border-top-color: var(--accent);
    animation: spin 0.9s linear infinite;
    flex-shrink: 0;
}
.studio-gen-timer {
    font-size: 11px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    color: var(--accent-sand); font-weight: 600;
    letter-spacing: 0.03em; line-height: 1;
}
.studio-result.has-image { cursor: zoom-in; }

/* ── Featured panel modal ────────────────────────────────────────────── */
.featured-modal {
    position: fixed; inset: 0; z-index: 250;
    background: rgba(0,0,0,0.92);
    display: flex; align-items: center; justify-content: center;
    padding: 16px; animation: fadeIn 0.2s;
}
.featured-modal[hidden] { display: none !important; }
.featured-modal-panel {
    background: var(--bg-card); border-radius: var(--radius);
    width: 100%; max-width: 720px; max-height: 92vh;
    overflow: hidden; border: 1px solid rgba(255,255,255,0.08);
    display: grid; grid-template-columns: 1fr 1fr;
    position: relative;
}
.featured-modal-close {
    position: absolute; top: 10px; right: 12px;
    width: 32px; height: 32px; border: none; border-radius: 50%;
    background: rgba(255,255,255,0.07); color: var(--text-dim);
    font-size: 24px; cursor: pointer; z-index: 10;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.18s, color 0.18s; line-height: 1; padding: 0;
}
.featured-modal-close:hover { background: rgba(255,255,255,0.15); color: var(--text); }
.featured-modal-img-side {
    background: var(--bg-input);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; min-height: 320px;
}
.featured-modal-img-side img {
    width: 100%; height: 100%;
    object-fit: contain; object-position: center; display: block;
}
.featured-modal-info {
    padding: 22px 20px 20px; overflow-y: auto;
    display: flex; flex-direction: column; gap: 12px;
    max-height: 92vh;
}
.fm-title {
    font-family: var(--font-display); font-size: 18px; font-weight: 600;
    color: var(--text); line-height: 1.2; padding-right: 28px;
}
.fm-meta { display: flex; gap: 10px; flex-wrap: wrap; }
.fm-meta-item { font-size: 11px; color: var(--text-dim); }
.fm-meta-hardcore { color: var(--accent-sand); font-weight: 700; }
.fm-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.fm-tag {
    font-size: 10px; color: var(--text-muted);
    background: var(--bg-input); border: 0.5px solid var(--border);
    padding: 3px 8px; border-radius: 20px;
}
.fm-preset {
    font-size: 11px; color: var(--text-dim);
    padding: 7px 10px; background: var(--bg-input); border-radius: 5px;
    display: flex; justify-content: space-between; align-items: center;
}
.fm-preset-val { color: var(--accent-sage); font-size: 11px; font-weight: 500; }
.fm-prompt-box { background: var(--bg-input); border-radius: 6px; padding: 10px; }
.fm-prompt-text {
    font-size: 11px; color: var(--text-dim); line-height: 1.55;
    display: -webkit-box; -webkit-line-clamp: 5;
    -webkit-box-orient: vertical; overflow: hidden;
}
.fm-prompt-lock {
    font-size: 10px; color: var(--text-muted);
    margin-top: 6px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.fm-prompt-lock-icon { color: var(--accent); }
.fm-prompt-lock-text { line-height: 1.35; }
.fm-actions { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: auto; padding-top: 4px; }
.fm-btn-recreate {
    width: min(100%, 220px);
    padding: 11px 16px; border: none; border-radius: var(--radius-sm);
    background: var(--gradient-cta); color: #050607;
    font-family: var(--font); font-size: 13px; font-weight: 700;
    cursor: pointer; transition: opacity 0.15s; text-align: center;
    box-shadow: 0 0 16px rgba(255,46,136,0.28);
}
.fm-btn-recreate:hover { opacity: 0.88; }
.fm-btn-animate {
    width: min(100%, 220px);
    padding: 9px 16px; border: 0.5px solid rgba(124,255,216,0.3);
    border-radius: var(--radius-sm);
    background: rgba(124,255,216,0.06); color: var(--accent-sage);
    font-family: var(--font); font-size: 13px; font-weight: 500;
    cursor: pointer; transition: all 0.15s; text-align: center;
}
.fm-btn-animate:hover { background: rgba(124,255,216,0.14); border-color: var(--accent-sage); }
.fm-btn-download {
    width: min(100%, 220px);
    padding: 9px 16px; border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input); color: var(--text-dim);
    font-family: var(--font); font-size: 12px; font-weight: 500;
    cursor: pointer; transition: all 0.15s; text-align: center;
    text-decoration: none; display: block;
}
.fm-btn-download:hover { background: var(--bg-hover); color: var(--text); border-color: rgba(255,255,255,0.2); }
.fm-btn-locked { opacity: 0.55; }
.fm-prompt-blur { filter: blur(4px); user-select: none; pointer-events: none; }
.fm-unlock-btn {
    background: none; border: none; color: var(--accent);
    font-size: 10px; cursor: pointer; font-family: var(--font);
    text-decoration: underline; padding: 0; line-height: 1;
}
.fm-unlock-btn:hover { color: var(--accent-hover); }
@media (max-width: 640px) {
    .featured-modal-panel { grid-template-columns: 1fr; overflow-y: auto; }
    .featured-modal-img-side { min-height: 200px; max-height: 45vh; }
    .featured-modal-info { max-height: none; }
}

/* ── Featured Video Feed (app): playing video cards, badge, chip ──────────── */
.featured-cat-video {
    border-color: rgba(124,255,216,0.4);
    color: var(--accent-sage);
    background: linear-gradient(135deg, rgba(124,255,216,0.14), rgba(255,46,136,0.05)), var(--bg-input);
    font-weight: 600;
}
.featured-cat-video.active {
    background: linear-gradient(135deg, #7CFFD8, #1f8f74);
    border-color: rgba(124,255,216,0.9);
    color: #05221a;
    box-shadow: 0 0 16px rgba(124,255,216,0.3);
}
.featured-card .featured-video {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: cover; display: block; background: #111;
    aspect-ratio: auto; opacity: 0; transition: opacity 0.35s; z-index: 2; pointer-events: none;
}
.featured-card .featured-video.playing { opacity: 1; }
.card-badge-video {
    position: absolute; top: 8px; left: 8px; z-index: 6;
    display: inline-flex; align-items: center; gap: 3px;
    padding: 2px 7px; border-radius: 999px;
    background: rgba(255,46,136,0.85); color: #fff;
    font-size: 10px; font-weight: 700; letter-spacing: 0.03em;
}
.card-animate-primary {
    background: var(--gradient-cta); color: #050607; font-weight: 700;
    box-shadow: 0 0 16px rgba(255,46,136,0.3);
}
.card-animate-primary:hover { background: var(--gradient-cta); opacity: 0.9; color: #050607; }
.featured-card.has-video .card-actions { z-index: 7; }

/* ── Toast (background-task notifications) ──────────────────────────────── */
.toast {
    position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(12px);
    z-index: 900; display: flex; align-items: center; gap: 12px;
    max-width: calc(100vw - 32px);
    padding: 12px 12px 12px 18px; border-radius: 14px;
    background: rgba(13,15,18,0.96); border: 1px solid rgba(255,46,136,0.4);
    box-shadow: 0 16px 50px rgba(0,0,0,0.5), 0 0 28px rgba(255,46,136,0.18);
    color: var(--text); font-family: var(--font); font-size: 14px;
    opacity: 0; transition: opacity 0.25s, transform 0.25s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-msg { white-space: nowrap; }
.toast-action {
    border: none; border-radius: 9px; padding: 8px 16px; cursor: pointer;
    background: var(--gradient-cta); color: #050607; font-family: var(--font);
    font-size: 13px; font-weight: 700; box-shadow: 0 0 16px rgba(255,46,136,0.3);
}
.toast-action:hover { opacity: 0.9; }
.toast-close {
    border: none; background: rgba(255,255,255,0.08); color: var(--text-dim);
    width: 28px; height: 28px; border-radius: 50%; cursor: pointer; font-size: 18px;
    display: flex; align-items: center; justify-content: center;
}
.toast-close:hover { background: rgba(255,255,255,0.16); color: var(--text); }
@media (max-width: 640px) {
    .toast { bottom: 78px; left: 12px; right: 12px; transform: translateY(12px); justify-content: space-between; }
    .toast.show { transform: translateY(0); }
}
