/* Vidz AI - Premium Theme CSS */
/* Inspired by Remini, Lensa AI, FaceApp */

:root {
    --primary: #00205B;
    --primary-rgb: 0, 32, 91;
    --secondary: #C5A900;
    --secondary-rgb: 197, 169, 0;
    --white: #FFFFFF;
    --dark: #1a1a2e;
    --dark-secondary: #16213e;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    --light: #f8f9fa;
    --gray: #6c757d;
    --body-bg: #f0f2f5;
    --card-shadow: 0 2px 12px rgba(0,0,0,.06);
    --card-shadow-hover: 0 8px 32px rgba(0,0,0,.12);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --mobile-nav-height: 68px;
    --glass-bg: rgba(255,255,255,.72);
    --glass-border: rgba(255,255,255,.25);
    --glass-blur: 20px;
    --transition-fast: .2s cubic-bezier(.4,0,.2,1);
    --transition-smooth: .35s cubic-bezier(.4,0,.2,1);
    --transition-spring: .5s cubic-bezier(.175,.885,.32,1.275);
    --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ───── Base ───── */
html { font-size: 15px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font-family);
    background: var(--body-bg);
    color: #1a1a1a;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    letter-spacing: -0.01em;
}
h1, h2, h3, h4, h5, h6, .fw-bold, .fw-semibold { font-family: var(--font-family); letter-spacing: -0.02em; }

/* Shared brand mark */
.brand-logo {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    color: var(--primary);
    text-decoration: none;
    white-space: nowrap;
}
.brand-logo:hover { color: var(--primary); }
.brand-logo__icon {
    width: 42px;
    height: 37px;
    object-fit: contain;
    flex: 0 0 auto;
}
.brand-logo__text {
    color: inherit;
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0;
}
.brand-logo__text strong {
    color: var(--secondary);
    font-weight: 800;
}
.brand-logo--compact { gap: .4rem; }
.brand-logo--compact .brand-logo__icon { width: 32px; height: 28px; }
.brand-logo--compact .brand-logo__text { font-size: 1.05rem; }
.brand-logo--auth { justify-content: center; }
.brand-logo--auth .brand-logo__icon { width: 55px; height: 49px; }
.brand-logo--auth .brand-logo__text { font-size: 1.65rem; }
.brand-logo--inverse { color: var(--white); }
.brand-logo--inverse:hover { color: var(--white); }
.app-topbar-brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    min-width: 0;
}
.app-topbar-brand .page-title {
    padding-left: .75rem;
    border-left: 1px solid #d7dce2;
}

/* ───── Utility Overrides ───── */
.text-primary { color: var(--primary) !important; }
.text-secondary { color: var(--secondary) !important; }
.bg-primary { background-color: var(--primary) !important; }
.bg-secondary { background-color: var(--secondary) !important; }
.bg-dark-sidebar { background-color: var(--dark) !important; }

.btn {
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}
.btn:active {
    transform: scale(.97);
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #001845 100%) !important;
    border: none !important;
    box-shadow: 0 4px 14px rgba(var(--primary-rgb), .35);
}
.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(var(--primary-rgb), .45);
    transform: translateY(-1px);
}
.btn-secondary {
    background: linear-gradient(135deg, var(--secondary) 0%, #d4b800 100%) !important;
    border: none !important;
    color: #1a1a1a !important;
    box-shadow: 0 4px 14px rgba(var(--secondary-rgb), .35);
}
.btn-secondary:hover {
    box-shadow: 0 6px 20px rgba(var(--secondary-rgb), .45);
    transform: translateY(-1px);
}
.btn-outline-primary {
    color: var(--primary) !important;
    border-color: var(--primary) !important;
    background: transparent !important;
}
.btn-outline-primary:hover {
    background: var(--primary) !important;
    color: var(--white) !important;
}

/* ───── Cards ───── */
.card {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    transition: all var(--transition-smooth);
    background: var(--white);
}

/* ───── Glass Card ───── */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: 0 4px 30px rgba(0,0,0,.06);
}

/* ───── Forms ───── */
.form-control, .form-select {
    border-radius: var(--radius-sm);
    border: 1.5px solid #dee2e6;
    padding: .65rem .9rem;
    font-size: .95rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .12);
}

/* ───── Password Toggle ───── */
.password-wrapper { position: relative; }
.password-wrapper .form-control { padding-right: 2.8rem; }
.password-toggle {
    position: absolute;
    right: .75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--gray);
    cursor: pointer;
    padding: 0;
    line-height: 1;
    font-size: 1.1rem;
}
.password-toggle:hover { color: var(--primary); }

/* ───── Auth Pages ───── */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, #001845 50%, #000a1f 100%);
    position: relative;
    overflow: hidden;
}
.auth-container::before {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(var(--secondary-rgb), .15) 0%, transparent 70%);
    top: -100px;
    right: -100px;
}
.auth-container::after {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(var(--secondary-rgb), .1) 0%, transparent 70%);
    bottom: -50px;
    left: -50px;
}
.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--white);
    border-radius: 20px;
    padding: 2rem 1.5rem;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
    position: relative;
    z-index: 1;
    animation: authSlideUp .5s ease-out;
}
.auth-card .logo { text-align: center; margin-bottom: 1.5rem; }
.auth-card .logo p { margin-top: .55rem; margin-bottom: 0; }

/* ───── Top Bar ───── */
.top-bar {
    background: rgba(255,255,255,.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: .75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(0,0,0,.06);
    position: sticky;
    top: 0;
    z-index: 1040;
}
.top-bar .page-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary);
    letter-spacing: -.01em;
}
.top-bar .credits-badge {
    background: linear-gradient(135deg, var(--secondary) 0%, #e6c700 100%);
    color: #1a1a1a;
    padding: .35rem .85rem;
    border-radius: 24px;
    font-weight: 700;
    font-size: .85rem;
    display: flex;
    align-items: center;
    gap: .4rem;
    text-decoration: none;
    box-shadow: 0 2px 12px rgba(var(--secondary-rgb), .3);
    transition: all var(--transition-fast);
}
.top-bar .credits-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 18px rgba(var(--secondary-rgb), .45);
}
.top-bar .topbar-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: var(--primary);
    text-decoration: none;
    background: rgba(var(--primary-rgb), .08);
}
.top-bar .topbar-logout:hover,
.top-bar .topbar-logout:focus {
    color: var(--danger);
    background: rgba(220, 53, 69, .1);
}

/* ───── Mobile Bottom Navigation ───── */
.mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--mobile-nav-height);
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0,0,0,.06);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 1050;
    padding-bottom: env(safe-area-inset-bottom, 0);
}
.mobile-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #9ca3af;
    font-size: .68rem;
    font-weight: 600;
    padding: .3rem 0;
    min-width: 56px;
    transition: all var(--transition-fast);
    position: relative;
}
.mobile-nav .nav-item i {
    font-size: 1.35rem;
    margin-bottom: 2px;
    transition: transform var(--transition-spring);
}
.mobile-nav .nav-item.active {
    color: var(--primary);
}
.mobile-nav .nav-item.active i {
    transform: scale(1.1);
}
.mobile-nav .nav-item.active::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: var(--primary);
    border-radius: 0 0 4px 4px;
}
.mobile-nav .nav-item:active i {
    transform: scale(.9);
}

/* ───── Page Content ───── */
.page-content {
    padding-bottom: calc(var(--mobile-nav-height) + 5.5rem);
    min-height: 100vh;
}

@media (min-width: 768px) {
    .mobile-nav {
        display: none;
    }
    .page-content {
        min-height: 0;
        padding-bottom: 1.5rem;
    }
    .whatsapp-support-float.has-mobile-nav {
        bottom: calc(18px + env(safe-area-inset-bottom, 0));
    }
}

/* ───── Feature Cards (Home) ───── */
.feature-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem 1rem;
    text-align: center;
    box-shadow: var(--card-shadow);
    text-decoration: none;
    color: inherit;
    transition: all var(--transition-smooth);
    display: block;
    position: relative;
    overflow: hidden;
}
.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}
.feature-card:hover,
.feature-card:active {
    transform: translateY(-3px) scale(1.01);
    box-shadow: var(--card-shadow-hover);
    color: inherit;
}
.feature-card:hover::before { opacity: 1; }
.feature-card.enhance-card::before { background: linear-gradient(90deg, var(--primary), #1e40af); }
.feature-card.studio-card::before { background: linear-gradient(90deg, var(--secondary), #e6c700); }

.feature-card .icon-wrap {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto .75rem;
    font-size: 1.5rem;
    transition: transform var(--transition-spring);
}
.feature-icon-img {
    width: 100%;
    height: 100%;
    border-radius: 16px;
    object-fit: cover;
    display: block;
}
.feature-card:active .icon-wrap { transform: scale(.9); }
.feature-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: .3rem; letter-spacing: -.01em; }
.feature-card p { font-size: .8rem; color: var(--gray); margin: 0; line-height: 1.3; }

/* ───── Stat Cards (Home) ───── */
.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: .85rem .5rem;
    text-align: center;
    box-shadow: var(--card-shadow);
    transition: all var(--transition-fast);
}
.stat-card:active { transform: scale(.97); }
.stat-card .stat-icon {
    font-size: 1.3rem;
    margin-bottom: .2rem;
    display: block;
}
.stat-card .stat-value {
    font-weight: 800;
    font-size: 1.15rem;
    line-height: 1.2;
}
.stat-card .stat-label {
    font-size: .68rem;
    color: var(--gray);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* ───── Horizontal Scroll Gallery ───── */
.hscroll-gallery {
    display: flex;
    gap: .65rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: .5rem;
    scrollbar-width: none;
}
.hscroll-gallery::-webkit-scrollbar { display: none; }
.hscroll-gallery .hscroll-item {
    flex: 0 0 42%;
    max-width: 180px;
    scroll-snap-align: start;
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    background: #fff;
    transition: transform var(--transition-fast);
    cursor: pointer;
}
.hscroll-gallery .hscroll-item:active { transform: scale(.97); }
.hscroll-gallery .hscroll-item img {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: contain;
    background: #050505;
}
.hscroll-gallery .hscroll-item .hscroll-meta {
    padding: .4rem .6rem;
    font-size: .72rem;
    color: var(--gray);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.hscroll-gallery .hscroll-item .hscroll-type {
    font-weight: 600;
    color: var(--primary);
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .03em;
}

/* ───── Upload Area ───── */
.upload-area {
    border: 2.5px dashed #d1d5db;
    border-radius: var(--radius);
    padding: 2.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-smooth);
    background: linear-gradient(135deg, #fafbfc 0%, #f5f6f8 100%);
    position: relative;
    overflow: hidden;
}
.upload-area::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(circle at center, rgba(var(--primary-rgb), .03) 0%, transparent 70%);
    opacity: 0;
    transition: opacity var(--transition-smooth);
}
.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(var(--primary-rgb),.02) 0%, rgba(var(--primary-rgb),.05) 100%);
    transform: scale(1.01);
}
.upload-area:hover::before,
.upload-area.dragover::before { opacity: 1; }

.upload-area .upload-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto .75rem;
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    transition: transform var(--transition-spring);
}
.upload-area:hover .upload-icon { transform: scale(1.08) translateY(-2px); }
.upload-area .upload-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: .25rem;
    color: #1a1a1a;
}
.upload-area .upload-subtitle {
    color: var(--gray);
    font-size: .85rem;
    margin-bottom: .65rem;
}
.upload-area .upload-badge {
    display: inline-block;
    background: rgba(var(--primary-rgb), .06);
    color: var(--gray);
    padding: .3rem .85rem;
    border-radius: 20px;
    font-size: .78rem;
    font-weight: 500;
}
.upload-area .preview-img {
    max-width: 100%;
    max-height: 280px;
    border-radius: var(--radius-sm);
    object-fit: contain;
}

/* ───── Source Buttons (Gallery/Camera) ───── */
.source-buttons {
    display: flex;
    gap: .5rem;
    margin-top: .75rem;
}
.source-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    padding: .65rem;
    border-radius: var(--radius-sm);
    background: var(--white);
    border: 1.5px solid #e5e7eb;
    color: #374151;
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}
.source-btn:active { transform: scale(.97); }
.source-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(var(--primary-rgb), .03);
}
.source-btn i { font-size: 1.1rem; }

/* ───── Action Button (Enhance/Create) ───── */
.action-btn {
    width: 100%;
    padding: .85rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    border: none;
    transition: all var(--transition-fast);
    margin-top: .75rem;
}
.action-btn:disabled {
    opacity: 1;
    transform: none !important;
    cursor: not-allowed;
    filter: saturate(.65);
    box-shadow: none;
}
.action-btn.btn-primary:disabled {
    background: linear-gradient(135deg, rgba(var(--primary-rgb), .58), rgba(0, 24, 69, .58)) !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff;
}
.action-btn.btn-secondary:disabled {
    background: linear-gradient(135deg, rgba(var(--secondary-rgb), .65), rgba(212, 184, 0, .65)) !important;
    color: #1a1a1a !important;
    -webkit-text-fill-color: #1a1a1a;
}
.action-btn:disabled i,
.action-btn:disabled span {
    opacity: 1;
}
.action-btn .credit-tag {
    background: rgba(255,255,255,.2);
    padding: .15rem .6rem;
    border-radius: 12px;
    font-size: .78rem;
    font-weight: 600;
}
.action-btn.btn-primary:disabled .credit-tag {
    background: rgba(255,255,255,.22);
    color: #fff !important;
    -webkit-text-fill-color: #fff;
}
.action-btn-icon-img {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    object-fit: cover;
    flex: 0 0 auto;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
}
.credit-needed-card {
    background: linear-gradient(135deg, rgba(var(--secondary-rgb), .08), rgba(var(--primary-rgb), .04));
    border: 1px solid rgba(var(--secondary-rgb), .28);
    border-radius: var(--radius-sm);
    padding: .85rem;
}
.credit-needed-card i {
    color: var(--secondary);
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* ───── Processing States ───── */
.processing-view {
    text-align: center;
    padding: 3rem 1.5rem;
    animation: fadeIn .4s ease;
}
.processing-ring {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.25rem;
    position: relative;
}
.processing-ring::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid #e5e7eb;
}
.processing-ring::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: var(--primary);
    animation: spin 1s linear infinite;
}
.processing-ring .ring-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary);
}
.processing-title {
    font-weight: 700;
    font-size: 1.15rem;
    margin-bottom: .4rem;
    letter-spacing: -.01em;
}
.processing-subtitle {
    color: var(--gray);
    font-size: .88rem;
    line-height: 1.5;
}
.processing-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    margin-top: 1.25rem;
}
.processing-step {
    display: flex;
    align-items: center;
    gap: .35rem;
    font-size: .78rem;
    color: #9ca3af;
    font-weight: 500;
    transition: color var(--transition-fast);
}
.processing-step.active { color: var(--primary); }
.processing-step.done { color: var(--success); }
.processing-step .step-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d1d5db;
    transition: all var(--transition-fast);
}
.processing-step.active .step-dot {
    background: var(--primary);
    animation: pulse 1.5s ease infinite;
}
.processing-step.done .step-dot { background: var(--success); }
.processing-bar {
    margin-top: 1.25rem;
    height: 3px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}
.processing-bar .bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 4px;
    animation: processingProgress 90s ease-out forwards;
}
/* Determinate variant: width driven by JS, no keyframe animation. */
.processing-bar.is-determinate {
    height: 8px;
    background: #e9ecef;
    box-shadow: inset 0 1px 2px rgba(0,0,0,.06);
}
.processing-bar.is-determinate .bar-fill {
    width: 0%;
    animation: none;
    transition: width .35s cubic-bezier(.4,0,.2,1);
    position: relative;
    overflow: hidden;
}
.processing-bar.is-determinate .bar-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.5), transparent);
    transform: translateX(-100%);
    animation: barShimmer 1.4s ease-in-out infinite;
}
@keyframes barShimmer {
    100% { transform: translateX(100%); }
}
.processing-percent {
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.03em;
    color: var(--primary);
    margin: .35rem 0 .15rem;
    font-variant-numeric: tabular-nums;
}

/* ───── Result Container ───── */
.result-view { animation: fadeIn .4s ease; }
.result-badge-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    margin-bottom: .75rem;
}
.result-badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .35rem .85rem;
    border-radius: 20px;
    font-size: .82rem;
    font-weight: 600;
    background: rgba(40,167,69,.1);
    color: var(--success);
}

/* ───── Before/After Comparison Slider ───── */
.result-image-frame {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    background: #eef2f7;
    min-height: 220px;
}
.result-image-frame > img,
.comparison-container img,
.sbs-panel img {
    transition: opacity .22s ease, transform .25s ease;
}
.result-image-frame > img.is-loading,
.comparison-container img.is-loading,
.sbs-panel img.is-loading {
    opacity: .2;
}
.result-image-loader {
    position: absolute;
    inset: 0;
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    color: var(--primary);
    font-size: .86rem;
    font-weight: 700;
    background: linear-gradient(135deg, rgba(255,255,255,.84), rgba(248,250,252,.72));
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    pointer-events: none;
}
.result-image-loader .spinner-border {
    color: var(--secondary);
}

.comparison-container {
    position: relative;
    width: 100%;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,.12);
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    cursor: col-resize;
}
.comparison-container img {
    display: block;
    width: 100%;
    pointer-events: none;
}
.comparison-after {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}
.comparison-after img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.comparison-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--white);
    box-shadow: 0 0 8px rgba(0,0,0,.3);
    z-index: 3;
    left: 50%;
    transform: translateX(-50%);
}
.comparison-handle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,.25);
    display: flex;
    align-items: center;
    justify-content: center;
}
.comparison-handle-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4;
    color: var(--primary);
    font-size: 1.1rem;
    pointer-events: none;
}
.comparison-label {
    position: absolute;
    bottom: 12px;
    padding: .3rem .7rem;
    border-radius: 16px;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    z-index: 2;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.comparison-label-before {
    left: 12px;
    background: rgba(0,0,0,.5);
    color: white;
}
.comparison-label-after {
    right: 12px;
    background: rgba(255,255,255,.85);
    color: var(--primary);
}

/* ───── Result Actions ───── */
.result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: .75rem;
}
.result-actions .btn {
    flex: 1 1 0;
    min-width: 0;
    min-height: 44px;
    padding: .68rem .58rem;
    font-size: .88rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    line-height: 1.15;
    white-space: nowrap;
}
.result-actions .social-share-btn {
    flex: 1 1 0;
}
.result-actions .btn-icon {
    width: 48px;
    flex: 0 0 48px;
    padding: .75rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

@media (max-width: 575.98px) {
    .result-actions {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: .45rem;
    }
    .result-actions .btn,
    .result-actions .social-share-btn,
    .result-actions .btn-icon {
        width: 100%;
        min-width: 0;
        min-height: 46px;
        flex: initial;
        padding: .58rem .35rem;
        font-size: .82rem;
        gap: .28rem;
    }
    .result-actions .btn i {
        font-size: .95rem;
        flex-shrink: 0;
    }
}

/* Toggle between comparison / single view */
.view-toggle {
    display: flex;
    background: #f1f3f5;
    border-radius: var(--radius-sm);
    padding: 3px;
    margin-bottom: .75rem;
}
.view-toggle-btn {
    flex: 1;
    padding: .45rem;
    border: none;
    background: transparent;
    border-radius: 7px;
    font-size: .82rem;
    font-weight: 600;
    color: var(--gray);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
}
.view-toggle-btn.active {
    background: var(--white);
    color: var(--primary);
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

/* ───── Fullscreen Image View ───── */
.fullscreen-viewer {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.95);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility .3s ease;
}
.fullscreen-viewer.active {
    opacity: 1;
    visibility: visible;
}
.fullscreen-viewer img {
    max-width: 95%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: var(--radius-sm);
    transition: transform .3s ease;
}
.fullscreen-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,.15);
    backdrop-filter: blur(10px);
    border: none;
    color: white;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10001;
    transition: all var(--transition-fast);
}
.fullscreen-close:hover { background: rgba(255,255,255,.25); }
.fullscreen-viewer img {
    transition: transform .25s ease;
}
.fullscreen-toolbar {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: .25rem;
    padding: .4rem .6rem;
    border-radius: 16px;
    background: rgba(0,0,0,.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 10001;
    border: 1px solid rgba(255,255,255,.1);
}
.fullscreen-toolbar .ft-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: rgba(255,255,255,.85);
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.fullscreen-toolbar .ft-btn:hover { background: rgba(255,255,255,.12); color: #fff; }
.fullscreen-toolbar .ft-btn:active { transform: scale(.9); }
.fullscreen-toolbar .ft-zoom-label {
    min-width: 42px;
    text-align: center;
    font-size: .75rem;
    font-weight: 700;
    color: rgba(255,255,255,.7);
    user-select: none;
}
.fullscreen-toolbar .ft-separator {
    width: 1px;
    height: 20px;
    background: rgba(255,255,255,.15);
    margin: 0 .15rem;
}

/* ───── Zoom Controls (inline on result pages) ───── */
.image-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    margin-top: .5rem;
    flex-wrap: wrap;
}
.image-controls .ctrl-group {
    display: flex;
    align-items: center;
    gap: .2rem;
    background: #f1f3f5;
    border-radius: var(--radius-sm);
    padding: 2px;
}
.image-controls .ctrl-btn {
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
    border-radius: 8px;
    color: var(--gray);
    font-size: .92rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.image-controls .ctrl-btn:hover { background: var(--white); color: var(--primary); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.image-controls .ctrl-btn:active { transform: scale(.92); }
.image-controls .ctrl-label {
    min-width: 36px;
    text-align: center;
    font-size: .72rem;
    font-weight: 700;
    color: var(--gray);
    user-select: none;
}
.image-controls .ctrl-divider {
    width: 1px;
    height: 18px;
    background: #d1d5db;
    margin: 0 .25rem;
}

/* ───── Side-by-Side Comparison ───── */
.sidebyside-container {
    display: flex;
    gap: .35rem;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,.12);
}
.sidebyside-container .sbs-panel {
    flex: 1;
    position: relative;
    min-width: 0;
}
.sidebyside-container .sbs-panel img {
    width: 100%;
    display: block;
    object-fit: cover;
    aspect-ratio: auto;
}
.sidebyside-container .sbs-label {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    padding: .2rem .55rem;
    border-radius: 12px;
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.sidebyside-container .sbs-label-before {
    background: rgba(0,0,0,.5);
    color: white;
}
.sidebyside-container .sbs-label-after {
    background: rgba(255,255,255,.85);
    color: var(--primary);
}

.fullscreen-actions {
    position: absolute;
    bottom: 2rem;
    display: flex;
    gap: .75rem;
    z-index: 10001;
}
.fullscreen-actions .btn {
    border-radius: 24px;
    padding: .6rem 1.25rem;
    backdrop-filter: blur(10px);
    font-size: .88rem;
}

/* ───── Instagram Feed Gallery ───── */
.ig-filter-tabs {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    margin: -.75rem -1rem .75rem;
    padding: 0;
}
.ig-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .2rem;
    padding: .65rem .5rem;
    text-decoration: none;
    color: #9ca3af;
    font-size: 1.15rem;
    position: relative;
    transition: color var(--transition-fast);
}
.ig-tab .ig-tab-count {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .02em;
}
.ig-tab:hover { color: #374151; }
.ig-tab.active { color: var(--primary); }
.ig-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%;
    right: 20%;
    height: 2px;
    background: var(--primary);
    border-radius: 2px 2px 0 0;
}

.ig-feed {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.gallery-manage-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin: .35rem 0 1rem;
    color: #6b7280;
    font-size: .9rem;
}
.gallery-manage-bar strong { color: var(--primary); }

.ig-post {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.ig-post-header {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .65rem .75rem;
}

.ig-post-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    color: var(--white);
    flex-shrink: 0;
}
.ig-avatar-enhance {
    background: linear-gradient(135deg, var(--primary) 0%, #1e40af 100%);
}
.ig-avatar-studio {
    background: linear-gradient(135deg, var(--secondary) 0%, #d4b800 100%);
}

.ig-post-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.ig-post-type {
    font-size: .82rem;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.2;
}
.ig-post-time {
    font-size: .7rem;
    color: #9ca3af;
    line-height: 1.2;
}

.ig-post-image {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    background: #050505;
    display: grid;
    place-items: center;
    aspect-ratio: 4 / 5;
}
.ig-post-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    transition: transform .4s ease;
}
.ig-post-image:active img { transform: scale(.98); }

.ig-post-actions {
    display: flex;
    align-items: center;
    gap: .25rem;
    padding: .5rem .65rem;
}

.ig-post-controls {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
}

.ig-card-delete {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #dc2626;
    background: rgba(220,38,38,.08);
    transition: transform .18s ease, background .18s ease;
}
.ig-card-delete:hover {
    background: rgba(220,38,38,.14);
    transform: translateY(-1px);
}
.ig-card-delete:disabled {
    opacity: .6;
    transform: none;
}

.ig-action-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #374151;
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}
.ig-action-btn:hover { background: #f3f4f6; color: var(--primary); }
.ig-action-btn:active { transform: scale(.9); }
.ig-action-whatsapp { color: #128c4a; }
.ig-action-facebook { color: #1877f2; }

/* ───── Lightbox ───── */
.picha-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0,0,0,.97);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility .3s ease;
}
.picha-lightbox.active { opacity: 1; visibility: visible; }
.picha-lightbox-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    color: white;
    position: relative;
    z-index: 2;
}
.picha-lightbox-counter {
    font-size: .85rem;
    font-weight: 600;
    opacity: .7;
}
.picha-lightbox-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,.1);
    border: none;
    color: white;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition-fast);
}
.picha-lightbox-close:hover { background: rgba(255,255,255,.2); }
.picha-lightbox-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    touch-action: pan-y;
}
.picha-lightbox-body img {
    max-width: 94%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: var(--radius-sm);
    user-select: none;
    -webkit-user-select: none;
    transition: opacity .4s cubic-bezier(.22, 1, .36, 1), transform .4s cubic-bezier(.22, 1, .36, 1);
}
.picha-lightbox-hd {
    position: absolute;
    top: .85rem;
    right: 1rem;
    border: 0;
    border-radius: 999px;
    background: rgba(255,255,255,.92);
    color: var(--primary);
    font-size: .72rem;
    font-weight: 800;
    padding: .35rem .65rem;
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    box-shadow: 0 10px 24px rgba(0,0,0,.22);
    z-index: 4;
}
.picha-lightbox-hd:active { transform: scale(.96); }
.picha-lightbox-compare-nav {
    position: absolute;
    left: 50%;
    bottom: .75rem;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .25rem;
    border-radius: 999px;
    background: rgba(0,0,0,.48);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 4;
}
.picha-lightbox-compare-btn {
    min-width: 94px;
    height: 36px;
    border: 0;
    border-radius: 999px;
    background: rgba(255,255,255,.13);
    color: white;
    font-size: .78rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .2rem;
}
.picha-lightbox-compare-btn.active {
    background: white;
    color: var(--primary);
}
.picha-lightbox-footer {
    padding: .75rem 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    color: white;
    position: relative;
    z-index: 2;
}
.picha-lightbox-info {
    font-size: .82rem;
    opacity: .6;
    text-align: center;
}
.picha-lightbox-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .5rem;
}
.picha-lightbox-actions .lb-btn {
    padding: .55rem 1.1rem;
    border-radius: 24px;
    font-size: .85rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: .35rem;
    transition: all var(--transition-fast);
}
.picha-lightbox-actions .lb-btn:active { transform: scale(.95); }
.picha-lightbox-actions .lb-btn-primary {
    background: var(--primary);
    color: white;
}
.picha-lightbox-actions .lb-btn-ghost {
    background: rgba(255,255,255,.12);
    color: white;
}
.picha-lightbox-actions .lb-btn-ghost:hover {
    background: rgba(255,255,255,.2);
}
.picha-lightbox-actions .lb-btn-danger {
    background: rgba(239,68,68,.18);
    color: #fecaca;
}
.picha-lightbox-actions .lb-btn-danger:hover {
    background: rgba(239,68,68,.28);
    color: #fff;
}

.picha-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,.1);
    border: none;
    color: white;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 3;
    transition: background var(--transition-fast);
}
.picha-lightbox-nav:hover { background: rgba(255,255,255,.2); }
.picha-lightbox-prev { left: .75rem; }
.picha-lightbox-next { right: .75rem; }

/* ───── Credit Package Cards (Improved) ───── */
.package-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.45rem .85rem 1rem;
    text-align: center;
    box-shadow: var(--card-shadow);
    transition: all var(--transition-smooth);
    cursor: pointer;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}
.package-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    opacity: 0;
    transition: opacity var(--transition-fast);
}
.package-card:hover,
.package-card.selected {
    transform: translateY(-3px);
    box-shadow: var(--card-shadow-hover);
    border-color: var(--primary);
}
.package-card.selected::before { opacity: 1; }
.package-card .credits {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}
.package-card .price {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--secondary);
    margin-top: .4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    flex-wrap: wrap;
}
.package-card .regular-price {
    color: #94a3b8;
    font-size: .78rem;
    font-weight: 700;
    text-decoration: line-through;
}
.package-card .name {
    font-size: .82rem;
    color: var(--gray);
    margin-top: .25rem;
    font-weight: 500;
}
.package-card--unlimited {
    border-color: rgba(var(--secondary-rgb), .28);
    background: linear-gradient(180deg, rgba(var(--secondary-rgb), .09), var(--white) 46%);
}
.package-ribbon {
    position: absolute;
    top: .55rem;
    right: .55rem;
    display: inline-flex;
    align-items: center;
    padding: .22rem .45rem;
    border-radius: 999px;
    background: rgba(var(--primary-rgb), .92);
    color: var(--white);
    font-size: .62rem;
    font-weight: 800;
    line-height: 1;
}
.package-ribbon--promo {
    background: #166534;
}
.package-allowance {
    min-height: 1.1rem;
    margin-top: .25rem;
    color: #475569;
    font-size: .76rem;
    font-weight: 700;
}
.package-value-grid {
    display: grid;
    gap: .35rem;
    margin-top: .7rem;
    text-align: left;
}
.package-value-grid span {
    display: flex;
    align-items: center;
    gap: .35rem;
    min-height: 1.35rem;
    padding: .32rem .45rem;
    border-radius: 7px;
    background: #f8fafc;
    color: #334155;
    font-size: .68rem;
    font-weight: 700;
    line-height: 1.25;
}
.package-value-grid i {
    color: var(--secondary);
    font-size: .78rem;
    flex: 0 0 auto;
}
.package-save,
.package-tip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .2rem;
    min-height: 1.45rem;
    margin-top: .55rem;
    padding: .34rem .45rem;
    border-radius: 8px;
    font-size: .7rem;
    font-weight: 800;
    line-height: 1.2;
}
.package-save {
    background: rgba(22, 101, 52, .08);
    color: rgba(22, 101, 52, .72);
    border: 1px solid rgba(22, 101, 52, .12);
    font-size: .66rem;
    font-weight: 700;
}
.package-save small {
    font-size: .62rem;
    font-weight: 700;
}
.package-tip {
    background: rgba(var(--primary-rgb), .06);
    color: var(--primary);
}
.package-watermark-note {
    display: flex;
    align-items: center;
    gap: .45rem;
    margin: 0 0 .75rem;
    padding: .62rem .75rem;
    border-radius: var(--radius-sm);
    color: #064e3b;
    background: rgba(16, 185, 129, .1);
    border: 1px solid rgba(16, 185, 129, .22);
    font-size: .82rem;
    font-weight: 800;
    line-height: 1.3;
}
.package-watermark-note i {
    color: #047857;
    flex: 0 0 auto;
}
.package-watermark-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .25rem;
    margin-top: .45rem;
    padding: .24rem .5rem;
    border-radius: 999px;
    color: #047857;
    background: rgba(16, 185, 129, .1);
    font-size: .67rem;
    font-weight: 800;
    line-height: 1.1;
}
.package-watermark-chip i {
    font-size: .72rem;
}
.selected-credit-summary {
    background: linear-gradient(135deg, rgba(var(--secondary-rgb), .06), rgba(var(--secondary-rgb), .12));
    border: 1px solid rgba(var(--secondary-rgb), .18);
}

.sms-offer-countdown {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: .75rem;
    margin: 0 0 1rem;
    padding: .8rem .9rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(var(--secondary-rgb), .35);
    background: linear-gradient(135deg, rgba(var(--secondary-rgb), .14), rgba(var(--primary-rgb), .06));
}
.sms-offer-countdown__icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a1a1a;
    background: var(--secondary);
}
.sms-offer-countdown__copy {
    min-width: 0;
}
.sms-offer-countdown__copy strong,
.sms-offer-countdown__copy span {
    display: block;
}
.sms-offer-countdown__copy strong {
    color: var(--primary);
    font-size: .92rem;
}
.sms-offer-countdown__copy span {
    color: #475569;
    font-size: .78rem;
    line-height: 1.35;
}
.sms-offer-countdown__timer {
    min-width: 76px;
    padding: .45rem .55rem;
    border-radius: 8px;
    color: var(--white);
    background: var(--primary);
    text-align: center;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}
.sms-offer-countdown--expired {
    opacity: .75;
}
@media (max-width: 420px) {
    .sms-offer-countdown {
        grid-template-columns: auto 1fr;
    }
    .sms-offer-countdown__timer {
        grid-column: 1 / -1;
        width: 100%;
    }
}

/* ───── Status Badges ───── */
.status-badge {
    padding: .25rem .65rem;
    border-radius: 20px;
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .02em;
}
.status-completed { background: #dcfce7; color: #166534; }
.status-processing { background: #fef3c7; color: #92400e; }
.status-failed { background: #fce4ec; color: #b71c1c; }
.status-pending { background: #f1f3f5; color: #495057; }
.status-active { background: #dcfce7; color: #166534; }
.status-inactive { background: #f1f3f5; color: #495057; }
.status-banned { background: #fce4ec; color: #b71c1c; }
.status-admin { background: linear-gradient(135deg, rgba(var(--primary-rgb),.1), rgba(var(--secondary-rgb),.1)); color: var(--primary); }
.status-user { background: #e8f4f8; color: #0c5460; }

/* ───── Empty State ───── */
.empty-state {
    text-align: center;
    padding: 3.5rem 1.5rem;
    color: var(--gray);
}
.empty-state .empty-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 1rem;
    border-radius: 20px;
    background: #f1f3f5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #9ca3af;
}
.empty-state h5 { font-weight: 700; color: #374151; margin-bottom: .3rem; }
.empty-state p { font-size: .88rem; margin-bottom: 1rem; }

/* ───── Profile Page ───── */
.profile-header {
    text-align: center;
    padding: 1.5rem 1rem;
    background: linear-gradient(135deg, rgba(var(--primary-rgb),.04) 0%, rgba(var(--secondary-rgb),.04) 100%);
    border-radius: var(--radius);
    margin-bottom: .75rem;
}
.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 22px;
    background: linear-gradient(135deg, var(--primary), #1e40af);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: .65rem;
    box-shadow: 0 4px 14px rgba(var(--primary-rgb), .3);
}
.profile-name { font-weight: 700; font-size: 1.15rem; margin-bottom: .15rem; }
.profile-phone { font-size: .88rem; color: var(--gray); }

.profile-menu .list-group-item {
    border: none;
    padding: .85rem 1rem;
    transition: background var(--transition-fast);
    font-weight: 500;
}
.profile-menu .list-group-item:active { background: #f8f9fa; }
.profile-menu .list-group-item i { width: 24px; text-align: center; }
.profile-menu .profile-logout,
.profile-menu .profile-logout span,
.profile-menu .profile-logout i {
    color: var(--danger);
    font-weight: 600;
}

/* ───── Processing Overlay ───── */
.processing-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.7);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    color: #fff;
}
.processing-overlay .spinner-border {
    width: 3rem;
    height: 3rem;
    margin-bottom: 1rem;
}

/* ───── Admin Sidebar ───── */
.admin-sidebar {
    position: fixed;
    top: 0; left: 0;
    width: 250px;
    height: 100vh;
    background: var(--dark);
    color: #ccc;
    z-index: 1060;
    overflow-y: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
    transition: transform .3s;
}
.admin-sidebar::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}
.admin-sidebar .brand {
    padding: 1.25rem;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--white);
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.admin-sidebar .brand .brand-logo__icon { width: 39px; height: 35px; }
.admin-sidebar .brand .brand-logo__text { color: var(--white); font-size: 1.22rem; }
.admin-sidebar .brand .brand-logo__text strong { color: var(--secondary); }
.admin-sidebar .nav-link {
    color: #adb5bd;
    padding: .65rem 1.25rem;
    display: flex;
    align-items: center;
    gap: .6rem;
    font-size: .9rem;
    transition: background .2s, color .2s;
    text-decoration: none;
}
.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    background: rgba(255,255,255,.08);
    color: var(--white);
}
.admin-sidebar .nav-link.active { border-left: 3px solid var(--secondary); }
.admin-sidebar .nav-link i { font-size: 1.1rem; width: 20px; text-align: center; }
.admin-content { margin-left: 250px; min-height: 100vh; }
@media (max-width: 768px) {
    .admin-sidebar { transform: translateX(-100%); }
    .admin-sidebar.show { transform: translateX(0); }
    .admin-content { margin-left: 0; }
}

.admin-gen-thumb { object-fit: cover; vertical-align: middle; }
.admin-gen-photo-pair {
    display: inline-flex;
    align-items: flex-start;
    gap: .45rem;
}
.admin-gen-photo {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: .18rem;
    color: inherit;
    text-decoration: none;
}
.admin-gen-photo span {
    font-size: .64rem;
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
    color: var(--gray);
}
.admin-gen-photo:hover img {
    border-color: var(--primary) !important;
}
.admin-gen-photo-empty {
    cursor: default;
    opacity: .72;
}
.admin-gen-photo-pair-mobile {
    gap: .35rem;
}

/* ───── Tables (Admin) ───── */
.admin-generations-filter .input-group-text {
    background: #fff;
    color: var(--gray);
}
.provider-cost-card {
    overflow: hidden;
}
.provider-cost-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
}
.provider-cost-value {
    line-height: 1.2;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.provider-cost-page .table-responsive {
    overflow-x: auto;
}
.admin-filter-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
}
.model-select-wrap {
    display: flex;
    align-items: center;
    gap: .45rem;
    min-width: 0;
}
.model-favicon-slot {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    flex: 0 0 18px;
}
.model-favicon-slot img,
.model-current-favicon {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    object-fit: contain;
    flex: 0 0 auto;
}
.model-select-with-icon {
    min-width: 14rem;
    flex: 1 1 auto;
}
.model-route-badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    margin-bottom: .22rem;
    padding: .18rem .45rem;
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 800;
    line-height: 1.15;
    color: var(--primary);
    background: rgba(var(--primary-rgb), .08);
    border: 1px solid rgba(var(--primary-rgb), .14);
}
.model-route-badge--replicate {
    color: #111827;
    background: #f3f4f6;
    border-color: #d1d5db;
}
.model-route-badge--fal {
    color: #7c2d12;
    background: #fff7ed;
    border-color: #fed7aa;
}
.model-route-badge--openrouter {
    color: #075985;
    background: #e0f2fe;
    border-color: #bae6fd;
}
.admin-gen-mobile-card {
    overflow: hidden;
}
.admin-gen-mobile-name {
    font-size: .9rem;
    line-height: 1.15;
}
.admin-gen-mobile-phone {
    font-size: .72rem;
    line-height: 1.2;
}
.admin-gen-mobile-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.generation-status-icon {
    width: 1.8rem;
    height: 1.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-size: 1rem;
}
.generation-status-icon.status-completed { background: #dcfce7; color: #15803d; }
.generation-status-icon.status-processing { background: #fef3c7; color: #a16207; }
.generation-status-icon.status-failed { background: #fee2e2; color: #b91c1c; }
.admin-generation-reconcile {
    width: 2.35rem;
    height: 2.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: .65rem;
}
.admin-spin { animation: admin-spin .8s linear infinite; }
@keyframes admin-spin { to { transform: rotate(360deg); } }
.admin-generation-prompt {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    max-height: 15rem;
    overflow-y: auto;
    padding: .75rem;
    border: 1px solid var(--border);
    border-radius: .5rem;
    background: #f8fafc;
    color: #24334a;
    font-size: .82rem;
    line-height: 1.55;
}
.admin-generation-attachment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: .65rem;
}
.admin-generation-attachment-grid a {
    display: block;
    aspect-ratio: 1;
    border: 1px solid var(--border);
    border-radius: .5rem;
    overflow: hidden;
    background: #f4f6f8;
}
.admin-generation-attachment-grid img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.admin-gen-feature-chip {
    max-width: 8.5rem;
}

.generation-watermark-upsell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .5rem .75rem;
    color: #566174;
    font-size: .76rem;
    font-weight: 600;
    border-top: 1px solid var(--border);
    background: #fff;
}
.generation-watermark-upsell span {
    min-width: 0;
    line-height: 1.25;
}
.generation-watermark-upsell .btn {
    flex-shrink: 0;
    padding: .22rem .55rem;
    font-size: .72rem;
    line-height: 1.2;
    border-radius: .45rem;
}
.admin-gen-mobile-line {
    min-width: 0;
    font-size: .78rem;
}
.admin-gen-mobile-actions .btn {
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.admin-gen-viewer-stage {
    min-height: min(68vh, 620px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0f172a;
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.admin-gen-viewer-stage img {
    display: block;
    max-width: 100%;
    max-height: min(68vh, 620px);
    object-fit: contain;
    transition: opacity .18s ease;
}
.admin-gen-viewer-stage img.is-loading {
    opacity: .35;
}
.admin-gen-viewer-nav {
    display: flex;
    justify-content: center;
    gap: .5rem;
    margin-top: .75rem;
}
.admin-gen-viewer-nav .btn {
    min-width: 7rem;
}
.admin-gen-viewer-nav .btn.active {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
}
@media (max-width: 576px) {
    .provider-cost-metrics {
        --bs-gutter-x: .75rem;
        --bs-gutter-y: .75rem;
    }
    .provider-cost-card {
        padding: .85rem !important;
        border-radius: .85rem;
    }
    .provider-cost-card .d-flex {
        align-items: flex-start !important;
    }
    .provider-cost-icon {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
        font-size: .95rem;
    }
    .provider-cost-value {
        font-size: .92rem;
        max-width: 100%;
    }
    .provider-cost-summary-table,
    .provider-cost-summary-table thead,
    .provider-cost-summary-table tbody,
    .provider-cost-summary-table tr,
    .provider-cost-summary-table th,
    .provider-cost-summary-table td,
    .provider-cost-detail-table,
    .provider-cost-detail-table thead,
    .provider-cost-detail-table tbody,
    .provider-cost-detail-table tr,
    .provider-cost-detail-table th,
    .provider-cost-detail-table td {
        display: block;
        width: 100%;
    }
    .provider-cost-summary-table thead,
    .provider-cost-detail-table thead {
        display: none;
    }
    .provider-cost-summary-table tr,
    .provider-cost-detail-table tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .45rem .7rem;
        margin: .6rem .65rem;
        padding: .7rem .75rem;
        border: 1px solid var(--border);
        border-radius: .75rem;
        background: #fff;
        box-shadow: 0 8px 22px rgba(17, 24, 39, .06);
    }
    .provider-cost-summary-table td,
    .provider-cost-detail-table td {
        display: block;
        padding: 0;
        border: 0;
        text-align: left;
        overflow-wrap: anywhere;
        font-size: .78rem;
        line-height: 1.18;
    }
    .provider-cost-summary-table td::before,
    .provider-cost-detail-table td::before {
        content: attr(data-label);
        display: block;
        color: var(--gray);
        font-size: .66rem;
        font-weight: 700;
        line-height: 1.1;
        margin-bottom: .12rem;
        text-align: left;
    }
    .provider-cost-summary-table td:first-child,
    .provider-cost-detail-table td:first-child {
        grid-column: 1 / -1;
        padding-bottom: .45rem;
        margin-bottom: .05rem;
        border-bottom: 1px solid var(--border);
        font-size: .9rem;
    }
    .provider-cost-summary-table td:first-child::before,
    .provider-cost-detail-table td:first-child::before {
        display: none;
    }
    .provider-cost-summary-table td .small,
    .provider-cost-detail-table td .small {
        font-size: .68rem;
        line-height: 1.15;
    }
    .provider-cost-summary-table .badge,
    .provider-cost-detail-table .badge {
        white-space: normal;
    }
    .provider-cost-detail-table td:nth-child(6),
    .provider-cost-detail-table td:nth-child(7) {
        grid-column: 1 / -1;
    }
    .provider-cost-detail-table .text-truncate {
        max-width: 100% !important;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }
    .provider-cost-detail-table td:nth-child(12) .btn {
        width: 2rem;
        height: 2rem;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .picha-lightbox-hd {
        top: .55rem;
        right: .65rem;
        font-size: .68rem;
        padding: .3rem .55rem;
    }
    .picha-lightbox-compare-nav {
        bottom: .5rem;
    }
    .picha-lightbox-compare-btn {
        min-width: 82px;
        height: 34px;
        font-size: .72rem;
    }
    .admin-gen-viewer-modal .modal-dialog {
        margin: .5rem;
    }
    .admin-gen-viewer-stage {
        min-height: 58vh;
    }
    .admin-gen-viewer-stage img {
        max-height: 58vh;
    }
    .admin-gen-viewer-nav {
        gap: .35rem;
    }
    .admin-gen-viewer-nav .btn {
        flex: 1;
        min-width: 0;
        padding-left: .35rem;
        padding-right: .35rem;
    }
}
.admin-user-gen-summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .25rem;
    min-width: 8.5rem;
}
.admin-user-gen-total {
    font-size: .72rem;
    font-weight: 800;
    color: var(--primary);
}
.admin-user-gen-chip {
    display: inline-flex;
    align-items: center;
    gap: .18rem;
    padding: .12rem .34rem;
    border-radius: 999px;
    background: #f1f5f9;
    color: #334155;
    font-size: .68rem;
    font-weight: 700;
    line-height: 1.35;
}
.admin-user-gen-chip i {
    color: var(--secondary);
    font-size: .72rem;
}
.admin-user-gen-summary-mobile {
    min-width: 0;
}
.admin-user-gen-summary-mobile .admin-user-gen-total {
    width: 100%;
}
.table-condensed th, .table-condensed td { padding: .4rem .5rem; font-size: .85rem; }
@media (max-width: 576px) {
    .ig-filter-tabs { margin: -.75rem -0.75rem .75rem; }
    .table-responsive-cards .table { display: none; }
    .table-responsive-cards .card-stack { display: block; }
    .admin-generations-filter {
        margin-left: -.25rem;
        margin-right: -.25rem;
        border-radius: 1rem;
    }
    .admin-generations-filter .card-body {
        padding: .75rem;
    }
    .admin-generations-filter .form-label {
        margin-bottom: .25rem;
        font-size: .7rem;
        color: var(--gray);
    }
    .admin-generations-filter .form-control,
    .admin-generations-filter .form-select,
    .admin-generations-filter .input-group-text,
    .admin-generations-filter .btn {
        min-height: 2.35rem;
        border-radius: .75rem;
    }
    .admin-generations-filter .input-group .input-group-text {
        border-top-right-radius: 0;
        border-bottom-right-radius: 0;
    }
    .admin-generations-filter .input-group .form-control {
        border-top-left-radius: 0;
        border-bottom-left-radius: 0;
    }
    .admin-generations-count {
        display: inline-flex;
        align-items: center;
        padding: .35rem .55rem;
        margin-top: .65rem !important;
        border-radius: 999px;
        background: rgba(var(--primary-rgb), .06);
        color: var(--primary) !important;
    }
    .admin-gen-mobile-card {
        padding: .65rem;
        border-radius: 1rem;
    }
    .admin-gen-photo-pair-mobile {
        gap: .28rem;
    }
    .admin-gen-photo-pair-mobile .admin-gen-photo {
        position: relative;
    }
    .admin-gen-photo-pair-mobile .admin-gen-photo span {
        position: absolute;
        z-index: 2;
        margin: .22rem;
        width: 1rem;
        height: 1rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 999px;
        background: rgba(2, 22, 73, .82);
        color: #fff;
        font-size: .58rem;
    }
    .admin-gen-photo-pair-mobile .admin-gen-thumb {
        width: 54px !important;
        height: 54px !important;
        border-radius: .65rem !important;
    }
    .admin-gen-mobile-status {
        width: 1.75rem;
        height: 1.75rem;
    }
    .admin-gen-feature-chip {
        max-width: 7rem;
    }
    .admin-gen-mobile-line .text-nowrap {
        font-size: .74rem;
        max-width: 7.2rem;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}
@media (min-width: 577px) {
    .table-responsive-cards .card-stack { display: none; }
}
.card-stack .stack-card {
    background: #fff;
    border-radius: var(--radius-sm);
    padding: .75rem;
    margin-bottom: .5rem;
    box-shadow: var(--card-shadow);
}
.card-stack .stack-card .row-label { font-size: .75rem; color: var(--gray); font-weight: 500; }
.card-stack .stack-card .row-value { font-size: .9rem; font-weight: 500; }

.share-credit-card {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .85rem;
    margin: -.25rem 0 1rem;
    color: var(--primary);
    text-decoration: none;
    background: linear-gradient(135deg, rgba(var(--secondary-rgb), .18), rgba(var(--primary-rgb), .08));
    border: 1px solid rgba(var(--secondary-rgb), .32);
    border-radius: var(--radius-sm);
    box-shadow: var(--card-shadow);
}
.share-credit-card:hover {
    color: var(--primary);
    transform: translateY(-1px);
}
.share-credit-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: var(--secondary);
    flex: 0 0 42px;
}
.share-credit-copy {
    flex: 1;
    min-width: 0;
}
.share-credit-copy strong,
.share-credit-copy small {
    display: block;
}
.share-credit-copy small {
    color: #475569;
    font-size: .78rem;
    margin-top: .12rem;
}
.share-page-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--card-shadow);
    text-align: center;
}
.share-page-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto .75rem;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    font-size: 1.6rem;
}
.share-page-card h1 {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: .35rem;
}
.share-page-card p {
    color: #475569;
    margin-bottom: 1rem;
}
.share-link-box {
    display: flex;
    gap: .5rem;
    align-items: center;
    padding: .5rem;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    background: #f8fafc;
    margin-bottom: .65rem;
}
.share-link-box code {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--primary);
    text-align: left;
}
.share-actions {
    display: grid;
    gap: .5rem;
    margin-top: 1rem;
}
.share-actions .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    min-height: 44px;
}
.share-note {
    display: flex;
    align-items: flex-start;
    gap: .45rem;
    margin-top: 1rem;
    padding: .75rem;
    border-radius: var(--radius-sm);
    background: #f8fafc;
    color: #64748b;
    font-size: .8rem;
    text-align: left;
}
@media (min-width: 576px) {
    .share-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
.share-stat-card,
.share-rate-card {
    height: 100%;
    padding: .8rem;
    border-radius: var(--radius-sm);
    background: #fff;
    box-shadow: var(--card-shadow);
}
.share-stat-card {
    display: flex;
    flex-direction: column;
    gap: .22rem;
}
.share-stat-card i {
    font-size: 1.05rem;
}
.share-stat-card strong,
.share-rate-card strong {
    font-size: 1.2rem;
    line-height: 1.1;
    color: var(--primary);
}
.share-stat-card span,
.share-rate-card span {
    color: #64748b;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
}
.share-rate-card {
    text-align: center;
}
.share-rate-card strong,
.share-rate-card span {
    display: block;
}

/* ───── Section Headers ───── */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .75rem;
}
.section-title {
    font-weight: 700;
    font-size: 1rem;
    color: #1f2937;
    letter-spacing: -.01em;
}
.section-link {
    font-size: .85rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: .25rem;
}

/* ───── Animations ───── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes authSlideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .5; transform: scale(1.2); }
}
@keyframes processingProgress {
    0% { width: 5%; }
    20% { width: 25%; }
    40% { width: 45%; }
    60% { width: 60%; }
    80% { width: 75%; }
    100% { width: 92%; }
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes shimmer {
    0% { background-position: -200px 0; }
    100% { background-position: 200px 0; }
}

.animate-in { animation: fadeIn .4s ease forwards; }
.animate-in-up { animation: fadeInUp .5s ease forwards; }
.stagger-1 { animation-delay: .05s; opacity: 0; }
.stagger-2 { animation-delay: .1s; opacity: 0; }
.stagger-3 { animation-delay: .15s; opacity: 0; }
.stagger-4 { animation-delay: .2s; opacity: 0; }

/* ───── Greeting Hero ───── */
.greeting-hero {
    padding: .5rem 0 .75rem;
}
.greeting-hello {
    font-size: .88rem;
    color: var(--gray);
    font-weight: 500;
    margin-bottom: .1rem;
}
.greeting-name {
    font-size: 1.3rem;
    font-weight: 800;
    color: #111827;
    letter-spacing: -.02em;
    line-height: 1.2;
}
.greeting-sub {
    font-size: .85rem;
    color: #9ca3af;
    margin-top: .2rem;
}

/* ───── Responsive enhancements ───── */
@media (min-width: 400px) {
    .hscroll-gallery .hscroll-item { flex: 0 0 38%; }
}

/* ═══════════════════════════════════════════════════
   UI/UX polish additions
   ═══════════════════════════════════════════════════ */

/* Top-of-page progress bar (network activity) */
.nav-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0;
    z-index: 10600;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    box-shadow: 0 0 8px rgba(var(--secondary-rgb), .6);
    border-radius: 0 2px 2px 0;
    pointer-events: none;
}

/* Styled confirm dialog */
.picha-confirm-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: rgba(15, 23, 42, .55);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity .2s ease;
}
.picha-confirm-backdrop.active { opacity: 1; }
.picha-confirm {
    width: 100%;
    max-width: 360px;
    background: #fff;
    border-radius: var(--radius);
    padding: 1.6rem 1.35rem 1.35rem;
    text-align: center;
    box-shadow: 0 24px 60px rgba(0,0,0,.28);
    transform: translateY(12px) scale(.96);
    transition: transform .22s cubic-bezier(.22,1,.36,1);
}
.picha-confirm-backdrop.active .picha-confirm { transform: translateY(0) scale(1); }
.picha-confirm-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto .85rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 1.5rem;
}
.picha-confirm-icon.danger { background: rgba(220,53,69,.12); color: var(--danger); }
.picha-confirm-icon.primary { background: rgba(var(--primary-rgb),.12); color: var(--primary); }
.picha-confirm-icon.warning { background: rgba(255,193,7,.16); color: #b8860b; }
.picha-confirm-title { font-weight: 800; font-size: 1.1rem; margin-bottom: .4rem; letter-spacing: -.02em; }
.picha-confirm-msg { color: var(--gray); font-size: .9rem; line-height: 1.5; margin-bottom: 1.2rem; }
.picha-confirm-actions { display: flex; gap: .6rem; }
.picha-confirm-actions .btn { font-weight: 600; border-radius: var(--radius-sm); padding: .6rem; }

/* Skeleton loaders */
.skeleton {
    position: relative;
    overflow: hidden;
    background: #e9edf2;
    border-radius: var(--radius-sm);
}
.skeleton::after {
    content: '';
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.6), transparent);
    animation: barShimmer 1.5s ease-in-out infinite;
}
.skeleton-text { height: .8rem; margin-bottom: .5rem; border-radius: 4px; }
.skeleton-text.w-60 { width: 60%; }
.skeleton-text.w-80 { width: 80%; }
.skeleton-thumb { width: 100%; aspect-ratio: 1; border-radius: var(--radius-sm); }

/* Empty states */
.empty-state {
    text-align: center;
    padding: 2.5rem 1.25rem;
    color: var(--gray);
}
.empty-state .empty-icon {
    width: 76px;
    height: 76px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 2rem;
    background: rgba(var(--primary-rgb), .07);
    color: var(--primary);
}
.empty-state h5 { font-weight: 800; color: #1f2937; margin-bottom: .35rem; letter-spacing: -.01em; }
.empty-state p { font-size: .9rem; max-width: 300px; margin: 0 auto 1.1rem; line-height: 1.55; }

/* Form controls: real-time validation feedback */
.form-control.is-valid, .form-control.is-invalid { background-position: right .6rem center; }
.field-hint { font-size: .78rem; color: var(--gray); margin-top: .3rem; }
.field-error { font-size: .8rem; color: var(--danger); margin-top: .3rem; display: none; }
.field-error.show { display: block; }
.form-control.is-invalid { border-color: var(--danger); }
.form-control.is-valid { border-color: var(--success); }

/* Vidz AI minimalist application shell and feedback surfaces */
.app-container { width: 100%; max-width: 760px; margin: 0 auto; }
.top-bar { min-height: 64px; padding: .7rem max(1rem, env(safe-area-inset-left)) .7rem max(1rem, env(safe-area-inset-right)); background: rgba(255,255,255,.94); border-bottom: 1px solid #e8edf2; box-shadow: 0 1px 8px rgba(15,23,42,.04); }
.page-content { min-height: calc(100dvh - 64px); background: linear-gradient(180deg, #f8fafc 0%, var(--body-bg) 260px); }
.page-title { font-size: .9rem; font-weight: 750; color: #263449; }
.card, .vidz-rules, .vidz-summary, .upload-area, .vidz-job-card { box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.card:hover, .feature-card:hover, .vidz-job-card:hover { box-shadow: 0 8px 24px rgba(15,23,42,.08); }
.form-label { color: #263449; letter-spacing: .01em; }
.form-control, .form-select { min-height: 44px; background-color: #fff; }
textarea.form-control { min-height: 96px; resize: vertical; }
.btn:focus-visible, .form-control:focus-visible, .form-select:focus-visible, a:focus-visible { outline: 3px solid rgba(var(--secondary-rgb), .45); outline-offset: 2px; }
.btn[disabled], .btn.disabled { cursor: wait; opacity: .72; }
.offline-banner { position: fixed; left: 50%; bottom: calc(1rem + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 10800; display: flex; align-items: center; gap: .55rem; width: min(92vw, 440px); padding: .7rem .9rem; border: 1px solid #f0c36d; border-radius: 12px; background: #fff8e7; color: #714c00; box-shadow: 0 10px 30px rgba(15,23,42,.14); font-size: .8rem; font-weight: 650; animation: slideUp .25s ease both; }
.offline-banner.is-restored { background: #ecfdf5; border-color: #86efac; color: #166534; }
.processing-note { margin-top: .8rem; color: #718096; font-size: .72rem; }
.processing-note i { margin-right: .25rem; }
.processing-bar[role="progressbar"] { width: 100%; }
@keyframes slideUp { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (max-width: 575.98px) {
    .app-container { max-width: 100%; }
    .top-bar { min-height: 58px; }
    .page-content { min-height: calc(100dvh - 58px); }
    .btn { min-height: 42px; }
    .source-btn, .vidz-seg button { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

/* Password strength meter */
.pw-strength { margin-top: .5rem; }
.pw-strength-bar {
    height: 5px;
    border-radius: 4px;
    background: #e5e7eb;
    overflow: hidden;
}
.pw-strength-bar > span {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 4px;
    transition: width .3s ease, background .3s ease;
}
.pw-strength-label { font-size: .75rem; margin-top: .3rem; font-weight: 600; }
.pw-strength[data-score="1"] .pw-strength-bar > span { width: 25%; background: var(--danger); }
.pw-strength[data-score="2"] .pw-strength-bar > span { width: 50%; background: #f59e0b; }
.pw-strength[data-score="3"] .pw-strength-bar > span { width: 75%; background: #3b82f6; }
.pw-strength[data-score="4"] .pw-strength-bar > span { width: 100%; background: var(--success); }
.pw-strength[data-score="1"] .pw-strength-label { color: var(--danger); }
.pw-strength[data-score="2"] .pw-strength-label { color: #b8860b; }
.pw-strength[data-score="3"] .pw-strength-label { color: #2563eb; }
.pw-strength[data-score="4"] .pw-strength-label { color: var(--success); }

/* Button press micro-interaction */
.btn:active, .action-btn:active { transform: scale(.98); }

.whatsapp-support-float {
    position: fixed;
    right: 18px;
    bottom: calc(18px + env(safe-area-inset-bottom, 0));
    z-index: 1060;
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    min-height: 48px;
    padding: .7rem .95rem;
    border-radius: 999px;
    background: #25d366;
    color: #fff;
    text-decoration: none;
    font-weight: 800;
    font-size: .88rem;
    box-shadow: 0 14px 34px rgba(37, 211, 102, .34), 0 5px 14px rgba(0,0,0,.18);
}
.whatsapp-support-float:hover,
.whatsapp-support-float:focus {
    color: #fff;
    background: #1ebe5d;
    transform: translateY(-1px);
}
.whatsapp-support-float i { font-size: 1.35rem; line-height: 1; }
.whatsapp-support-float.has-mobile-nav {
    bottom: calc(82px + env(safe-area-inset-bottom, 0));
}

/* Text to Image: prompt-first creation workspace */
.tti-app {
    width: min(100%, 960px);
    min-height: calc(100dvh - 140px);
    margin: 0 auto;
    padding-bottom: 1.5rem;
}
.tti-appbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 58px;
    padding: .55rem .25rem;
    border-bottom: 1px solid #e5e7eb;
}
.tti-app-identity { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.tti-app-icon,
.tti-welcome-icon,
.tti-response-icon {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    color: var(--primary);
    background: #eef3fb;
}
.tti-app-icon { width: 40px; height: 40px; border-radius: 8px; font-size: 1.15rem; }
.tti-app-identity h1 { margin: 0; font-size: 1rem; line-height: 1.25; font-weight: 800; }
.tti-app-identity p {
    max-width: 540px;
    margin: .1rem 0 0;
    overflow: hidden;
    color: #6b7280;
    font-size: .76rem;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tti-cost {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    min-width: 50px;
    min-height: 32px;
    justify-content: center;
    padding: .35rem .65rem;
    border-radius: 999px;
    background: #fff7cc;
    color: #594a00;
    font-size: .84rem;
    font-weight: 800;
}
.tti-alert { max-width: 760px; margin: .75rem auto 0; }
.tti-create-view {
    display: flex;
    min-height: calc(100dvh - 260px);
    flex-direction: column;
    justify-content: center;
    padding: 2rem 0 3rem;
}
.tti-welcome { margin-bottom: 1.35rem; text-align: center; }
.tti-welcome-icon { width: 52px; height: 52px; margin-bottom: .8rem; border-radius: 8px; font-size: 1.35rem; }
.tti-welcome h2 { margin: 0; color: #111827; font-size: clamp(1.35rem, 3vw, 1.8rem); font-weight: 800; letter-spacing: 0; }
.tti-starters {
    display: grid;
    width: min(100%, 620px);
    margin: 0 auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .55rem;
}
.tti-starter {
    display: flex;
    align-items: center;
    gap: .65rem;
    min-width: 0;
    min-height: 46px;
    padding: .65rem .8rem;
    border: 1px solid #d9dee7;
    border-radius: 8px;
    background: #fff;
    color: #273244;
    text-align: left;
    transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.tti-starter:hover,
.tti-starter:focus-visible { border-color: rgba(var(--primary-rgb), .45); background: #f8faff; }
.tti-starter:active { transform: scale(.985); }
.tti-starter i { flex: 0 0 auto; color: var(--primary); font-size: 1rem; }
.tti-starter span { overflow: hidden; font-size: .85rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.tti-composer-wrap { width: min(100%, 760px); margin: 1rem auto 0; }
.tti-composer {
    position: relative;
    border: 1px solid #cfd6e1;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .09);
    transition: border-color .18s ease, box-shadow .18s ease;
}
.tti-composer:focus-within { border-color: rgba(var(--primary-rgb), .6); box-shadow: 0 14px 38px rgba(15, 23, 42, .12), 0 0 0 3px rgba(var(--primary-rgb), .07); }
#tti-prompt {
    display: block;
    width: 100%;
    min-height: 78px;
    max-height: 180px;
    padding: 1rem 1rem .35rem;
    border: 0;
    outline: 0;
    background: transparent;
    color: #111827;
    font: inherit;
    font-size: 1rem;
    line-height: 1.5;
    letter-spacing: 0;
    resize: none;
}
#tti-prompt::placeholder { color: #8991a0; }
.tti-composer-footer { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .45rem .55rem .55rem; }
.tti-tools,
.tti-submit-group { display: flex; align-items: center; gap: .45rem; min-width: 0; }
.tti-tool {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    min-height: 34px;
    padding: .35rem .6rem;
    border: 1px solid #d9dee7;
    border-radius: 999px;
    background: #fff;
    color: #344054;
    font-size: .77rem;
    font-weight: 700;
}
.tti-tool:hover { background: #f6f8fb; }
.tti-language { display: inline-flex; align-items: center; gap: .3rem; color: #7b8493; font-size: .73rem; font-weight: 700; white-space: nowrap; }
.tti-char { color: #98a0ad; font-size: .68rem; white-space: nowrap; }
.tti-send {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border: 0;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 1rem;
    box-shadow: 0 5px 12px rgba(var(--primary-rgb), .22);
}
.tti-send:disabled { background: #d6dae1; color: #8991a0; box-shadow: none; cursor: not-allowed; }
.tti-ratio-menu {
    position: absolute;
    z-index: 1080;
    bottom: calc(100% + .55rem);
    left: 0;
    width: min(100%, 590px);
    padding: .75rem;
    border: 1px solid #d9dee7;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 20px 50px rgba(15, 23, 42, .16);
}
.tti-ratio-menu[hidden] { display: none !important; }
.tti-ratio-menu-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .55rem; font-size: .83rem; font-weight: 800; }
.tti-ratio-menu-head button { display: grid; width: 30px; height: 30px; place-items: center; border: 0; border-radius: 50%; background: transparent; color: #687386; }
.tti-ratio-menu-head button:hover { background: #eef1f5; }
.tti-ratio-grid { display: grid; grid-template-columns: repeat(7, minmax(66px, 1fr)); gap: .4rem; overflow-x: auto; scrollbar-width: thin; }
.tti-ratio {
    position: relative;
    display: flex;
    min-height: 82px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: .38rem;
    padding: .5rem .3rem;
    border: 1px solid #e0e4ea;
    border-radius: 8px;
    background: #fff;
    color: #4b5565;
    font-size: .7rem;
    white-space: nowrap;
}
.tti-ratio:hover { background: #f8faff; }
.tti-ratio.active { border-color: var(--primary); background: rgba(var(--primary-rgb), .05); color: var(--primary); font-weight: 800; }
.tti-ratio > i { position: absolute; top: .35rem; right: .35rem; display: none; font-size: .72rem; }
.tti-ratio.active > i { display: block; }
.tti-shape,
.tti-mini-shape { display: inline-block; border: 2px solid currentColor; border-radius: 2px; }
.tti-shape { width: 25px; height: 25px; color: #8490a3; }
.tti-ratio.active .tti-shape { color: var(--primary); }
.tti-mini-shape { width: 14px; height: 14px; color: var(--primary); }
.tti-shape[data-ratio="9:16"] { width: 15px; height: 27px; }
.tti-shape[data-ratio="16:9"] { width: 30px; height: 17px; }
.tti-shape[data-ratio="3:4"] { width: 20px; height: 27px; }
.tti-shape[data-ratio="4:3"] { width: 28px; height: 21px; }
.tti-shape[data-ratio="2:3"] { width: 18px; height: 27px; }
.tti-shape[data-ratio="3:2"] { width: 29px; height: 19px; }
.tti-mini-shape[data-ratio="9:16"], .tti-mini-shape[data-ratio="2:3"] { width: 9px; height: 15px; }
.tti-mini-shape[data-ratio="16:9"], .tti-mini-shape[data-ratio="3:2"] { width: 17px; height: 10px; }
.tti-mini-shape[data-ratio="3:4"] { width: 11px; height: 15px; }
.tti-mini-shape[data-ratio="4:3"] { width: 16px; height: 12px; }
.tti-credit-warning { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: .6rem; padding: .55rem .7rem; border-radius: 8px; background: #fff8dd; color: #5f5100; font-size: .78rem; }
.tti-credit-warning span { display: inline-flex; align-items: center; gap: .4rem; }
.tti-credit-warning a { color: var(--primary); font-weight: 800; white-space: nowrap; }
.tti-state-view { width: min(100%, 760px); margin: 1.5rem auto 0; }
.tti-response { padding: .25rem 0 2rem; }
.tti-response-head { display: flex; align-items: center; gap: .65rem; }
.tti-response-icon { width: 38px; height: 38px; border-radius: 8px; }
.tti-result-prompt { margin: .8rem 0; color: #626c7b; font-size: .84rem; line-height: 1.45; }
.tti-result-frame {
    position: relative;
    display: grid;
    min-height: 260px;
    max-height: 70dvh;
    place-items: center;
    overflow: hidden;
    border: 1px solid #e1e5eb;
    border-radius: 8px;
    background: #f2f4f7;
}
.tti-result-frame img { display: block; width: 100%; height: auto; max-height: 70dvh; object-fit: contain; opacity: 1; transition: opacity .2s ease; }
.tti-result-frame.is-loading img { opacity: 0; }
.tti-image-loader { position: absolute; z-index: 1; display: none; color: var(--primary); }
.tti-result-frame.is-loading .tti-image-loader { display: inline-flex; }
.tti-result-actions { display: flex; align-items: center; gap: .55rem; margin-top: .75rem; }
.tti-result-actions .btn-icon { display: inline-grid; width: 42px; height: 42px; place-items: center; padding: 0; }
.tti-result-actions .tti-new { display: inline-flex; min-height: 42px; align-items: center; gap: .4rem; margin-left: auto; }

.itv-page { padding-bottom: 1rem; }
.itv-hero { display: flex; align-items: center; gap: .85rem; margin: .35rem 0 1rem; }
.itv-hero-icon { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 8px; background: linear-gradient(135deg, rgba(190,18,60,.10), rgba(14,165,233,.16)); color: #be123c; font-size: 1.35rem; }
.itv-hero h1 { margin: 0; color: var(--primary); font-size: 1.35rem; font-weight: 800; letter-spacing: 0; }
.itv-hero p { margin: .1rem 0 0; color: #667085; font-size: .86rem; line-height: 1.35; }
.itv-upload-area { min-height: 285px; }
.itv-panel { margin-bottom: .85rem; padding: .85rem; border: 1px solid #e4e8ef; border-radius: 8px; background: #fff; box-shadow: 0 6px 20px rgba(15,23,42,.05); }
.itv-panel textarea { border-radius: 8px; resize: vertical; }
.itv-help { margin-top: .45rem; color: #667085; font-size: .78rem; }
.itv-recorder { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.itv-recorder .btn { min-height: 38px; display: inline-flex; align-items: center; gap: .35rem; }
.itv-timer { display: inline-flex; min-width: 72px; justify-content: center; padding: .25rem .45rem; border-radius: 999px; background: #f1f5f9; color: #344054; font-size: .75rem; font-weight: 800; }
.itv-ratio-group { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
.itv-ratio-btn { min-height: 52px; border: 1px solid #dbe3ee; border-radius: 8px; background: #fff; color: #344054; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; }
.itv-ratio-btn.active { border-color: var(--primary); background: rgba(0,45,107,.06); color: var(--primary); box-shadow: 0 0 0 3px rgba(0,45,107,.08); }
.itv-video-frame { overflow: hidden; border: 1px solid #e1e5eb; border-radius: 8px; background: #080b12; }
.itv-video-frame video { display: block; max-height: 72dvh; background: #080b12; }
.ig-post[data-media="video"] .ig-post-image { background: #080b12; }
.ig-post-video { display: block; width: 100%; height: 100%; aspect-ratio: 1; object-fit: cover; }
.ig-video-play { position: absolute; left: 50%; top: 50%; display: grid; width: 46px; height: 46px; place-items: center; transform: translate(-50%, -50%); border-radius: 50%; background: rgba(0,45,107,.88); color: #fff; box-shadow: 0 12px 26px rgba(0,0,0,.25); pointer-events: none; }
.gallery-video-modal { position: fixed; inset: 0; z-index: 4000; display: grid; place-items: center; padding: 1rem; background: rgba(8,13,24,.92); }
.gallery-video-dialog { width: min(100%, 920px); }
.gallery-video-dialog video { display: block; width: 100%; max-height: 82dvh; border-radius: 8px; background: #000; }
.gallery-video-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .7rem; }

@media (max-width: 420px) {
    .whatsapp-support-float {
        right: 14px;
        min-width: 48px;
        width: 48px;
        height: 48px;
        justify-content: center;
        padding: 0;
    }
    .whatsapp-support-float span { display: none; }
}
@media (max-width: 767.98px) {
    .text-to-image-page .whatsapp-support-float { display: none; }
    .tti-app { min-height: calc(100dvh - 130px); padding: 0 .1rem calc(5.6rem + env(safe-area-inset-bottom, 0)); }
    .tti-appbar { min-height: 48px; padding: .35rem .15rem; }
    .tti-app-icon { width: 36px; height: 36px; }
    .tti-app-identity p { display: none; }
    .tti-create-view { min-height: auto; justify-content: flex-start; padding: .9rem 0 1.25rem; }
    .tti-welcome { margin-bottom: .7rem; }
    .tti-welcome-icon { width: 38px; height: 38px; margin-bottom: .45rem; font-size: 1rem; }
    .tti-welcome h2 { font-size: 1.2rem; }
    .tti-starters { gap: .45rem; }
    .tti-starter { min-height: 40px; padding: .45rem .6rem; }
    .tti-composer-wrap { margin-top: .55rem; }
    #tti-prompt { min-height: 60px; padding-top: .75rem; }
    .tti-language { display: none; }
    .tti-char { display: none; }
    .tti-ratio-menu { position: fixed; right: .75rem; bottom: calc(5.4rem + env(safe-area-inset-bottom, 0)); left: .75rem; width: auto; }
    .tti-ratio-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: visible; }
    .tti-ratio { min-height: 72px; }
    .tti-state-view { margin-top: 1rem; padding-bottom: calc(5rem + env(safe-area-inset-bottom, 0)); }
    .tti-result-frame { min-height: 220px; max-height: 62dvh; }
    .tti-result-frame img { max-height: 62dvh; }
    .itv-hero-icon { width: 42px; height: 42px; font-size: 1.12rem; }
    .itv-hero h1 { font-size: 1.18rem; }
    .itv-upload-area { min-height: 240px; }
    .itv-panel { padding: .75rem; }
    .itv-recorder .btn { flex: 1 1 auto; }
}

/* Respect notch / home-indicator safe areas on the bottom nav */
.mobile-nav { padding-bottom: env(safe-area-inset-bottom, 0); }

@media (prefers-reduced-motion: reduce) {
    .processing-bar.is-determinate .bar-fill::after,
    .skeleton::after { animation: none; }
}
