/* ─────────────────────────────────────────────────────────────────────────
   GlowEdit — Design System
   ───────────────────────────────────────────────────────────────────────── */

:root {
    /* ── Enterprise palette (navy/slate — Trust & Authority system) ─── */
    --bg:           #F8FAFC;
    --surface:      #FFFFFF;
    --surface-2:    #F1F5F9;
    --surface-3:    #E2E8F0;
    --text-1:       #0F172A;
    --text-2:       #475569;
    --text-3:       #94A3B8;
    --accent:       #1E3A5F;        /* navy — primary CTA */
    --accent-warm:  #2563EB;        /* blue — hover/link highlight */
    --accent-light: #EFF6FF;        /* blue-50 icon bg */
    --cta-green:    #059669;        /* emerald — secondary action */
    --danger:       #DC2626;
    --success:      #059669;
    --border:       #E2E8F0;
    --border-2:     #CBD5E1;
    --shadow-sm:    0 1px 3px rgba(15, 23, 42, .06);
    --shadow-md:    0 4px 16px rgba(15, 23, 42, .08);
    --shadow-lg:    0 12px 40px rgba(15, 23, 42, .12);
    --radius-xs:    6px;
    --radius-sm:    8px;
    --radius-md:    14px;
    --radius-lg:    20px;
    --radius-xl:    28px;
    /* ── Typography (Plus Jakarta Sans — enterprise SaaS) ────────────── */
    --font-display: 'Plus Jakarta Sans', -apple-system, system-ui, sans-serif;
    --font:         'Plus Jakarta Sans', -apple-system, system-ui, sans-serif;
    /* ── Motion (subtle — power1.out) ───────────────────────────────── */
    --ease:         cubic-bezier(.25, .46, .45, .94);
    --ease-spring:  cubic-bezier(.16, 1, .3, 1);
    --dur:          .16s;
    --sidebar-w:    220px;
    --nav-h:        64px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text-1);
    line-height: 1.5;
    overflow-x: hidden;
}

img {
    display: block;
    max-width: 100%;
}

button {
    cursor: pointer;
    font-family: inherit;
    border: none;
    background: none;
}

input,
textarea {
    font-family: inherit;
}

[hidden] {
    display: none !important;
}


/* ═══════════════════════════════════════════════════════════════════════════
   LANDING PAGE  (Enterprise — Trust & Authority system)
═══════════════════════════════════════════════════════════════════════════ */

#landing-screen { min-height: 100dvh; background: var(--bg); }

/* ── Nav ── */
.lp-nav {
    position: sticky; top: 0; z-index: 100;
    background: rgba(248, 250, 252, .92);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}
.lp-nav-inner {
    max-width: 1200px; margin: 0 auto; padding: 0 32px;
    height: var(--nav-h); display: flex; align-items: center; gap: 32px;
}
.lp-nav-links {
    display: none; align-items: center; gap: 4px; flex: 1;
}
@media (min-width: 768px) { .lp-nav-links { display: flex; } }
.lp-nav-link {
    padding: 8px 14px; border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 500; color: var(--text-2);
    text-decoration: none; transition: background var(--dur), color var(--dur);
}
.lp-nav-link:hover { background: var(--surface-2); color: var(--text-1); }

.btn-nav-cta {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 9px 20px; background: var(--accent); color: #FFF;
    border-radius: var(--radius-sm); font-size: 14px; font-weight: 600;
    white-space: nowrap; cursor: pointer;
    transition: background var(--dur), box-shadow var(--dur);
    box-shadow: 0 1px 3px rgba(30, 58, 95, .3);
}
.btn-nav-cta:hover { background: #162d4a; box-shadow: 0 2px 8px rgba(30, 58, 95, .4); }

/* ── Hero ── */
.lp-hero {
    padding: 88px 32px 72px;
    border-bottom: 1px solid var(--border);
}
.lp-inner { max-width: 1200px; margin: 0 auto; }

.lp-kicker {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 12px; font-weight: 700; letter-spacing: .8px;
    text-transform: uppercase; color: var(--accent-warm);
    margin-bottom: 24px;
}
.lp-kicker::before {
    content: ''; display: block; width: 20px; height: 2px;
    background: var(--accent-warm); border-radius: 2px;
}

.lp-headline {
    font-family: var(--font-display);
    font-size: clamp(40px, 5.5vw, 72px);
    font-weight: 800; letter-spacing: -2px; line-height: 1.06;
    color: var(--text-1); margin-bottom: 22px; max-width: 760px;
}
.lp-accent { color: var(--accent); }

.lp-sub {
    font-size: clamp(16px, 1.8vw, 19px); color: var(--text-2);
    line-height: 1.65; max-width: 560px; margin-bottom: 36px;
}

.lp-hero-ctas {
    display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 48px;
}
.btn-hero {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 14px 28px; background: var(--accent); color: #FFF;
    border-radius: var(--radius-sm); font-size: 16px; font-weight: 700;
    cursor: pointer; letter-spacing: -.2px;
    transition: background var(--dur), box-shadow var(--dur), transform var(--dur) var(--ease);
    box-shadow: 0 2px 8px rgba(30, 58, 95, .3);
}
.btn-hero:hover { background: #162d4a; box-shadow: 0 4px 16px rgba(30, 58, 95, .4); }
.btn-hero:active { transform: scale(.98); }

.btn-outline-hero {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 14px 28px; background: transparent; color: var(--text-1);
    border: 1.5px solid var(--border-2); border-radius: var(--radius-sm);
    font-size: 16px; font-weight: 600; text-decoration: none;
    cursor: pointer; letter-spacing: -.2px;
    transition: border-color var(--dur), background var(--dur), color var(--dur);
}
.btn-outline-hero:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }

/* ── Stats row ── */
.lp-stats-row {
    display: flex; align-items: center; gap: 0;
    padding: 20px 24px; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius-md);
    width: fit-content;
}
.lp-stat { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 0 28px; }
.lp-stat strong { font-size: 22px; font-weight: 800; color: var(--accent); letter-spacing: -1px; }
.lp-stat span { font-size: 12px; color: var(--text-2); font-weight: 500; white-space: nowrap; }
.lp-stat-divider { width: 1px; height: 36px; background: var(--border); flex-shrink: 0; }

/* ── Steps ── */
.lp-steps { padding: 80px 32px; background: var(--surface); }
.lp-overline {
    font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
    color: var(--accent-warm); margin-bottom: 10px;
}
.lp-section-h {
    font-family: var(--font-display);
    font-size: clamp(26px, 3.5vw, 40px); font-weight: 800;
    letter-spacing: -1px; color: var(--text-1); margin-bottom: 52px;
}
.lp-steps-grid {
    display: flex; align-items: flex-start; flex-direction: column; gap: 0;
}
@media (min-width: 768px) {
    .lp-steps-grid { flex-direction: row; align-items: center; }
}
.lp-step { flex: 1; padding: 8px 0; }
@media (min-width: 768px) { .lp-step { padding: 0 40px 0 0; } }
.lp-step-num {
    font-size: 13px; font-weight: 700; color: var(--accent-warm);
    letter-spacing: .5px; text-transform: uppercase;
    margin-bottom: 10px; display: block;
}
.lp-step h3 { font-size: 17px; font-weight: 700; letter-spacing: -.3px; margin-bottom: 8px; color: var(--text-1); }
.lp-step p { font-size: 14px; color: var(--text-2); line-height: 1.65; }
.lp-step-line {
    width: 1px; height: 40px; background: var(--border); flex-shrink: 0; margin: 8px 0;
}
@media (min-width: 768px) {
    .lp-step-line { width: 48px; height: 1px; margin: 0; }
}

/* ── Features ── */
.lp-features { padding: 80px 32px; }
.lp-feat-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
    background: var(--border); border: 1px solid var(--border);
    border-radius: var(--radius-md); overflow: hidden;
}
@media (min-width: 768px) { .lp-feat-grid { grid-template-columns: repeat(3, 1fr); } }

.lp-feat {
    padding: 28px 24px; background: var(--surface);
    cursor: default; transition: background var(--dur);
}
.lp-feat:hover { background: var(--surface-2); }

.lp-feat-icon {
    width: 40px; height: 40px; border-radius: var(--radius-sm);
    background: var(--accent-light); color: var(--accent-warm);
    display: flex; align-items: center; justify-content: center; margin-bottom: 14px;
}
.lp-feat h3 { font-size: 15px; font-weight: 700; letter-spacing: -.2px; margin-bottom: 6px; color: var(--text-1); }
.lp-feat p { font-size: 13px; color: var(--text-2); line-height: 1.6; }

/* ── CTA ── */
.lp-cta-section {
    padding: 80px 32px; background: var(--accent); text-align: center;
}
.lp-cta-section .lp-kicker { color: rgba(255,255,255,.6); }
.lp-cta-section .lp-kicker::before { background: rgba(255,255,255,.4); }
.lp-cta-inner { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.lp-cta-h {
    font-family: var(--font-display);
    font-size: clamp(28px, 3.5vw, 44px); font-weight: 800;
    letter-spacing: -1.5px; line-height: 1.1; color: #FFF;
}
.lp-cta-section .btn-hero {
    background: #FFF; color: var(--accent); box-shadow: none;
}
.lp-cta-section .btn-hero:hover { background: #EFF6FF; }

/* ── Footer ── */
.lp-footer {
    padding: 20px 32px; border-top: 1px solid rgba(255,255,255,.15);
    background: var(--accent); font-size: 13px; color: rgba(255,255,255,.5);
}
.lp-footer .lp-nav-inner { justify-content: space-between; }

/* ═══════════════════════════════════════════════════════════════════════════
   SHARED BUTTONS, FIELDS, UTILS
═══════════════════════════════════════════════════════════════════════════ */

.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-icon {
    font-size: 20px;
    color: var(--accent-warm);
}

.brand-name {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -.7px;
}

.brand-icon-sm {
    font-size: 15px;
    color: var(--accent-warm);
}

.brand-name-sm {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -.4px;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    background: var(--accent);
    color: #FFF;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -.2px;
    transition: opacity var(--dur), transform var(--dur) var(--ease);
    min-height: 44px;
}

.btn-primary:active {
    transform: scale(.97);
    opacity: .85;
}

.btn-primary:disabled {
    opacity: .4;
    pointer-events: none;
}

.btn-full {
    width: 100%;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
    min-height: 36px;
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    color: var(--text-2);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    transition: background var(--dur), color var(--dur);
}

.btn-ghost:hover {
    background: var(--surface-2);
    color: var(--text-1);
}

.btn-text {
    font-size: 13px;
    font-weight: 500;
    color: var(--accent-warm);
    padding: 4px;
    border-radius: 4px;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: var(--text-1);
    transition: background var(--dur);
}

.btn-icon:hover {
    background: var(--surface-2);
}

.btn-white {
    background: rgba(255, 255, 255, .15);
    color: #FFF;
    backdrop-filter: blur(8px);
}

.btn-white:hover {
    background: rgba(255, 255, 255, .25);
}

.btn-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: var(--text-1);
    transition: background var(--dur);
}

.btn-back:hover {
    background: var(--surface-2);
}

.btn-danger {
    color: var(--danger);
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-2);
    letter-spacing: .3px;
    text-transform: uppercase;
}

.field-input {
    width: 100%;
    padding: 13px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    color: var(--text-1);
    background: var(--surface);
    outline: none;
    transition: border-color var(--dur);
    -webkit-appearance: none;
}

.field-input:focus {
    border-color: var(--accent);
}

.field-hint {
    font-size: 12px;
    color: var(--text-3);
}

.form-error {
    background: #FEE;
    border: 1px solid #FCC;
    border-radius: var(--radius-xs);
    padding: 10px 14px;
    font-size: 14px;
    color: var(--danger);
}


/* ═══════════════════════════════════════════════════════════════════════════
   AUTH MODAL
═══════════════════════════════════════════════════════════════════════════ */

.auth-modal {
    max-width: 400px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 24px 24px 32px;
    padding-bottom: calc(32px + env(safe-area-inset-bottom));
}

@media (min-width: 640px) {
    .auth-modal {
        border-radius: var(--radius-lg);
        padding: 32px;
    }
}

.auth-modal-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.auth-modal-title {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -.8px;
    margin-bottom: 6px;
}

.auth-modal-sub {
    font-size: 14px;
    color: var(--text-2);
    margin-bottom: 24px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}


/* ═══════════════════════════════════════════════════════════════════════════
   MAIN APP LAYOUT
═══════════════════════════════════════════════════════════════════════════ */

.app-layout {
    display: flex;
    min-height: 100dvh;
    min-height: 100vh;
    position: relative;
}

/* ── Sidebar (desktop) ── */
.sidebar {
    display: none;
    /* shown on desktop via media query */
    width: var(--sidebar-w);
    flex-shrink: 0;
    height: 100dvh;
    height: 100vh;
    position: sticky;
    top: 0;
    flex-direction: column;
    border-right: 1px solid var(--border);
    background: var(--surface);
    padding: 24px 16px;
    z-index: 10;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px 24px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--border);
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 16px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-2);
    text-align: left;
    width: 100%;
    transition: background var(--dur), color var(--dur);
}

.sidebar-item:hover {
    background: var(--surface-2);
    color: var(--text-1);
}

.sidebar-item.active {
    background: var(--surface-2);
    color: var(--text-1);
    font-weight: 600;
}

.sidebar-item svg {
    flex-shrink: 0;
    opacity: .7;
}

.sidebar-item.active svg {
    opacity: 1;
}

.sidebar-footer {
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.sidebar-signout {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-3);
    transition: background var(--dur), color var(--dur);
    width: 100%;
}

.sidebar-signout:hover {
    background: var(--surface-2);
    color: var(--text-1);
}

/* ── App content area ── */
.app-content {
    flex: 1;
    min-width: 0;
    padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
    overflow-x: hidden;
}

/* ── Mobile bottom nav ── */
.mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    display: flex;
    background: rgba(250, 250, 248, .92);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom);
}

.mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px 8px;
    color: var(--text-3);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .2px;
    transition: color var(--dur);
    min-height: 56px;
}

.mobile-nav-item.active {
    color: var(--text-1);
}

/* ── Views ── */
.view {
    display: none;
}

.view.active {
    display: block;
}

/* ── View headers ── */
.view-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 16px 12px;
}

.view-title {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -1px;
}


/* ═══════════════════════════════════════════════════════════════════════════
   CREATE VIEW
═══════════════════════════════════════════════════════════════════════════ */

.create-layout {
    display: flex;
    flex-direction: column;
}

/* Photo upload area */
.upload-area {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--surface);
    border: 1.5px dashed var(--border-2);
    min-height: 200px;
    cursor: pointer;
    transition: border-color var(--dur), background var(--dur);
    margin: 16px 16px 0;
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--accent);
    background: var(--surface-2);
}

.upload-area.has-photos {
    border-style: solid;
    border-color: var(--border);
    background: var(--surface-3);
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 36px 24px;
    text-align: center;
}

.upload-icon {
    color: var(--text-3);
    margin-bottom: 4px;
}

.upload-primary {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-1);
}

.upload-secondary {
    font-size: 13px;
    color: var(--text-2);
}

.photo-previews {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 4px;
    padding: 8px;
    overflow-y: auto;
    /* scroll inside the upload area if many photos */
    height: 100%;
    align-content: start;
}

.photo-preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-xs);
    overflow: hidden;
    background: var(--surface-3);
}

.photo-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-preview-item .remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    background: rgba(0, 0, 0, .6);
    color: #FFF;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.add-more-btn {
    aspect-ratio: 1;
    border-radius: var(--radius-xs);
    border: 1.5px dashed var(--border-2);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-3);
    transition: border-color var(--dur), color var(--dur);
}

.add-more-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Edit panel */
.edit-panel {
    padding: 0 16px 24px;
}

.panel-section {
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.panel-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-2);
    letter-spacing: .5px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.panel-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.panel-label-row .panel-label {
    margin-bottom: 0;
}

.prompt-input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    color: var(--text-1);
    background: var(--surface);
    outline: none;
    resize: none;
    line-height: 1.6;
    transition: border-color var(--dur);
}

.prompt-input:focus {
    border-color: var(--accent);
}

.prompt-input::placeholder {
    color: var(--text-3);
}

/* Style chips */
.chip-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
}

.chip-scroll::-webkit-scrollbar {
    display: none;
}

.chip {
    flex-shrink: 0;
    padding: 7px 13px;
    border: 1.5px solid var(--border);
    border-radius: 100px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-2);
    background: var(--surface);
    white-space: nowrap;
    transition: all var(--dur) var(--ease);
}

.chip:hover {
    border-color: var(--text-2);
    color: var(--text-1);
}

.chip.selected {
    border-color: var(--accent);
    background: var(--accent);
    color: #FFF;
}

/* Outfit chips */
.outfit-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
}

.outfit-scroll::-webkit-scrollbar {
    display: none;
}

.outfit-chip {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-2);
    white-space: nowrap;
    transition: all var(--dur) var(--ease);
}

.outfit-chip:hover {
    border-color: var(--text-2);
}

.outfit-chip.selected {
    border-color: var(--accent);
    background: var(--accent);
    color: #FFF;
}

.outfit-chip-thumb {
    width: 26px;
    height: 26px;
    border-radius: 5px;
    object-fit: cover;
    flex-shrink: 0;
}

/* Aspect ratio */
.ratio-group {
    display: flex;
    gap: 8px;
}

.ratio-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 9px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-2);
    background: var(--surface);
    transition: all var(--dur) var(--ease);
    flex: 1;
}

.ratio-btn:hover {
    border-color: var(--text-2);
}

.ratio-btn.selected {
    border-color: var(--accent);
    background: var(--accent);
    color: #FFF;
}

.ratio-icon {
    display: block;
    background: currentColor;
    border-radius: 2px;
    opacity: .7;
}

.ratio-portrait {
    width: 12px;
    height: 16px;
}

.ratio-square {
    width: 14px;
    height: 14px;
}

.ratio-story {
    width: 9px;
    height: 16px;
}

.ratio-original {
    width: 14px;
    height: 10px;
}

/* Generate */
.generate-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 8px;
}

.variations-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.variations-picker {
    display: flex;
    gap: 6px;
}

.var-btn {
    width: 40px;
    height: 32px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
    background: var(--surface);
    transition: all var(--dur) var(--ease);
}

.var-btn:hover {
    border-color: var(--text-2);
    color: var(--text-1);
}

.var-btn.selected {
    border-color: var(--accent);
    background: var(--accent);
    color: #FFF;
}

.btn-generate {
    width: 100%;
    padding: 17px 24px;
    background: var(--accent);
    color: #FFF;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -.3px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: opacity var(--dur), transform var(--dur) var(--ease), box-shadow var(--dur);
    box-shadow: 0 4px 20px rgba(26, 26, 26, .2);
    min-height: 56px;
}

.btn-generate:not(:disabled):hover {
    box-shadow: 0 6px 28px rgba(26, 26, 26, .3);
}

.btn-generate:not(:disabled):active {
    transform: scale(.98);
    opacity: .9;
}

.btn-generate:disabled {
    opacity: .35;
    box-shadow: none;
    cursor: default;
}

.generate-icon {
    font-size: 18px;
}


/* ═══════════════════════════════════════════════════════════════════════════
   PHOTOS GALLERY
═══════════════════════════════════════════════════════════════════════════ */

.photos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    padding: 0 16px 16px;
}

.photo-card {
    aspect-ratio: 1;
    border-radius: 0;
    overflow: hidden;
    background: var(--surface-3);
    position: relative;
    cursor: pointer;
}

.photo-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s var(--ease);
}

.photo-card:hover img {
    transform: scale(1.04);
}

.photo-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, .5) 0%, transparent 50%);
    opacity: 0;
    transition: opacity var(--dur);
    display: flex;
    align-items: flex-end;
    padding: 8px;
    gap: 6px;
}

.photo-card:hover .photo-card-overlay {
    opacity: 1;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 60px 32px;
    text-align: center;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 8px;
}

.empty-title {
    font-size: 18px;
    font-weight: 600;
}

.empty-sub {
    font-size: 14px;
    color: var(--text-2);
    margin-bottom: 16px;
}

.load-more {
    padding: 16px;
    text-align: center;
}


/* ═══════════════════════════════════════════════════════════════════════════
   GENERATED IMAGES HISTORY
═══════════════════════════════════════════════════════════════════════════ */

.gen-history-title { font-size: 18px; font-weight: 700; letter-spacing: -.4px; }

.gen-history-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    padding: 0 16px 24px;
}

.gen-hist-card {
    position: relative;
    aspect-ratio: 4/5;
    overflow: hidden;
    background: var(--surface-3);
    cursor: pointer;
}
.gen-hist-card img { width: 100%; height: 100%; object-fit: cover; }

/* small source thumbnail badge */
.gen-hist-source {
    position: absolute !important;
    top: 6px; left: 6px;
    width: 32px; height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #FFF;
    box-shadow: 0 1px 4px rgba(0,0,0,.3);
    z-index: 2;
}

.gen-hist-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,.6) 0%, transparent 50%);
    opacity: 0; transition: opacity var(--dur);
    display: flex; align-items: flex-end; justify-content: space-between;
    padding: 8px;
}
.gen-hist-card:hover .gen-hist-overlay { opacity: 1; }
.gen-hist-count { font-size: 11px; font-weight: 600; color: #FFF; }
.gen-hist-view-btn { color: #FFF; font-size: 11px; font-weight: 600; }


/* ═══════════════════════════════════════════════════════════════════════════
   OUTFITS GALLERY
═══════════════════════════════════════════════════════════════════════════ */

.outfits-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 0 16px 16px;
}

.outfit-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--dur), transform var(--dur) var(--ease);
}

.outfit-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.outfit-card-img {
    aspect-ratio: 4/5;
    background: var(--surface-3);
    overflow: hidden;
}

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

.outfit-card-img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    background: linear-gradient(135deg, var(--surface-3), var(--surface-2));
}

.outfit-card-body {
    padding: 12px;
}

.outfit-card-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.outfit-card-date {
    font-size: 12px;
    color: var(--text-3);
    margin-bottom: 10px;
}

.outfit-card-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.outfit-card-actions .btn-secondary {
    padding: 6px 10px;
    font-size: 12px;
    border-radius: var(--radius-xs);
    flex: 1;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-2);
    color: var(--text-1);
    font-weight: 500;
    transition: background var(--dur);
}

.outfit-card-actions .btn-secondary:hover {
    background: var(--surface-3);
}


/* ═══════════════════════════════════════════════════════════════════════════
   GENERATION OVERLAY
═══════════════════════════════════════════════════════════════════════════ */

.overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: var(--bg);
    overflow-y: auto;
}

.gen-loading {
    min-height: 100dvh;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
}

.gen-loading-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    text-align: center;
    max-width: 280px;
}

.gen-spinner {
    width: 52px;
    height: 52px;
    position: relative;
}

.spinner-ring {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    animation: spin 1s linear infinite;
}

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

.gen-loading-title {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -.4px;
    animation: fadePulse 2.5s ease-in-out infinite;
}

.gen-loading-sub {
    font-size: 14px;
    color: var(--text-2);
}

@keyframes fadePulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: .55;
    }
}

.gen-results {
    padding-bottom: 32px;
}

.gen-results-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(250, 250, 248, .92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
}

.gen-results-title {
    flex: 1;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -.4px;
    text-align: center;
}

.variations-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 16px;
}

.variation-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: box-shadow var(--dur), transform var(--dur) var(--ease);
}

.variation-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.variation-img {
    aspect-ratio: 4/5;
    width: 100%;
    position: relative;
    overflow: hidden;
    background: var(--surface-3);
}

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

.variation-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0, 0, 0, .6);
    color: #FFF;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
}

.variation-actions {
    padding: 10px;
    display: flex;
    gap: 6px;
}

.variation-actions .btn-secondary {
    flex: 1;
    padding: 8px 6px;
    font-size: 11px;
    font-weight: 600;
    border-radius: var(--radius-xs);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-2);
    color: var(--text-1);
    transition: background var(--dur);
}

.variation-actions .btn-secondary:hover {
    background: var(--surface-3);
}


/* ═══════════════════════════════════════════════════════════════════════════
   FULLSCREEN VIEWER + BEFORE/AFTER
═══════════════════════════════════════════════════════════════════════════ */

.fullscreen-viewer {
    background: #000;
    display: flex;
    flex-direction: column;
}

.fullscreen-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    padding-top: calc(12px + env(safe-area-inset-top));
    background: linear-gradient(to bottom, rgba(0, 0, 0, .5), transparent);
}

.fs-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.fs-image-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.fs-image-wrap img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.fs-toolbar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
    background: linear-gradient(to top, rgba(0, 0, 0, .5), transparent);
    display: flex;
    justify-content: center;
    gap: 12px;
}

.comparison {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    user-select: none;
    touch-action: none;
}

.comparison-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.comparison-after-wrap {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.comparison-after-wrap .comparison-img {
    object-fit: contain;
}

.comparison-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #FFF;
    transform: translateX(-50%);
    box-shadow: 0 0 8px rgba(0, 0, 0, .5);
    cursor: ew-resize;
}

.comparison-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    background: #FFF;
    border-radius: 50%;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-1);
    font-size: 14px;
    font-weight: 700;
}

.comparison-label {
    position: absolute;
    bottom: 16px;
    background: rgba(0, 0, 0, .6);
    color: #FFF;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
    pointer-events: none;
}

.comparison-label-before {
    left: 12px;
}

.comparison-label-after {
    right: 12px;
}


/* ═══════════════════════════════════════════════════════════════════════════
   MODALS
═══════════════════════════════════════════════════════════════════════════ */

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 600;
    background: rgba(0, 0, 0, .48);
    display: flex;
    align-items: flex-end;
    backdrop-filter: blur(4px);
}

@media (min-width: 640px) {
    .modal-backdrop {
        align-items: center;
        justify-content: center;
        padding: 24px;
    }
}

.modal {
    background: var(--surface);
    width: 100%;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding-bottom: env(safe-area-inset-bottom);
    animation: slideUp .22s var(--ease);
    max-height: 80dvh;
    overflow-y: auto;
}

@media (min-width: 640px) {
    .modal {
        max-width: 440px;
        border-radius: var(--radius-lg);
        animation: scaleIn .18s var(--ease);
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(.95);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 4px;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -.4px;
}

.modal-body {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-footer {
    padding: 4px 20px 20px;
}


/* ═══════════════════════════════════════════════════════════════════════════
   TOASTS
═══════════════════════════════════════════════════════════════════════════ */

.toast-container {
    position: fixed;
    bottom: calc(var(--nav-h) + 12px + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    z-index: 800;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    width: min(360px, calc(100vw - 32px));
}

.toast {
    background: var(--text-1);
    color: #FFF;
    padding: 12px 18px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: toastIn .2s var(--ease);
    pointer-events: auto;
    width: 100%;
    text-align: center;
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--danger);
}

@keyframes toastIn {
    from {
        transform: translateY(8px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes toastOut {
    to {
        transform: translateY(8px);
        opacity: 0;
    }
}


/* ═══════════════════════════════════════════════════════════════════════════
   DESKTOP RESPONSIVE  ≥ 768px
═══════════════════════════════════════════════════════════════════════════ */

@media (min-width: 768px) {

    /* Show sidebar, hide mobile nav */
    .sidebar {
        display: flex;
    }

    .mobile-nav {
        display: none;
    }

    /* App content no longer needs bottom padding for mobile nav */
    .app-content {
        padding-bottom: 0;
    }

    /* Toast above screen bottom instead of above nav */
    .toast-container {
        bottom: 24px;
    }

    /* Create view: two-column sticky layout */
    .create-layout {
        display: grid;
        grid-template-columns: 1fr 1fr;
        min-height: 100dvh;
        min-height: 100vh;
        align-items: start;
    }

    .create-left {
        position: sticky;
        top: 0;
        padding: 24px;
        height: 100dvh;
        height: 100vh;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .create-left .upload-area {
        margin: 0;
        flex: 1;
        /* fill remaining height after padding */
        width: 100%;
        min-height: 0;
        /* allow shrinking below content size */
        aspect-ratio: unset;
        /* don't force a ratio that may overflow */
        overflow: hidden;
    }

    .create-right {
        padding: 24px 24px 24px 24px;
        /* no border-left — the background contrast handles separation */
    }

    .edit-panel {
        padding: 0;
    }

    /* Larger upload placeholder */
    .upload-placeholder {
        padding: 60px 24px;
    }

    /* Photos: 4 columns */
    .photos-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 3px;
        padding: 0 24px 24px;
    }

    .photo-card {
        border-radius: var(--radius-xs);
    }

    /* Outfits: 3 columns */
    .outfits-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
        padding: 0 24px 24px;
    }

    /* Results: 2 columns, centered */
    .variations-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 880px;
        margin: 0 auto;
        padding: 24px;
    }

    /* View header */
    .view-header {
        padding: 32px 24px 16px;
    }

    .view-title {
        font-size: 32px;
    }
}

@media (min-width: 1100px) {

    /* Photos: 5 columns */
    .photos-grid {
        grid-template-columns: repeat(5, 1fr);
    }

    /* Outfits: 4 columns */
    .outfits-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    /* Results: 4 columns */
    .variations-grid {
        grid-template-columns: repeat(4, 1fr);
        max-width: 1100px;
    }

    /* Wider create panel */
    .create-layout {
        grid-template-columns: 55% 45%;
    }
}


/* ═══════════════════════════════════════════════════════════════════════════
   SCROLL ANIMATIONS (Intersection Observer stagger)
   Design system: back.out(1.4) easing, 300-450ms duration
═══════════════════════════════════════════════════════════════════════════ */

.animate-in {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
    transition: opacity 380ms var(--ease-spring),
        transform 380ms var(--ease-spring);
}

.animate-in.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Stagger delay for siblings */
.animate-in:nth-child(2) {
    transition-delay: 60ms;
}

.animate-in:nth-child(3) {
    transition-delay: 120ms;
}

.animate-in:nth-child(4) {
    transition-delay: 180ms;
}

.animate-in:nth-child(5) {
    transition-delay: 240ms;
}

.animate-in:nth-child(6) {
    transition-delay: 300ms;
}

/* ── Respect prefers-reduced-motion (accessibility requirement) ─── */
@media (prefers-reduced-motion: reduce) {
    .animate-in {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .btn-hero,
    .lp-feat,
    .btn-generate,
    .outfit-card,
    .variation-card {
        transition: none !important;
        transform: none !important;
    }

    .spinner-ring {
        animation-duration: 2s;
    }

    .gen-loading-title {
        animation: none;
        opacity: 1;
    }
}