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

/* --- schedule maintenance --- */
.maintenance-banner {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto 0.75rem;
    padding: 0.65rem 1rem;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.82rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.maintenance-banner strong {
    color: #fbbf24;
}

.maintenance-banner svg {
    color: #fbbf24;
    flex-shrink: 0;
}

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a2e;
    --bg-card-hover: #22223a;
    --border-color: #2a2a4a;
    --border-focus: #6366f1;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-1: #6366f1;
    --accent-2: #a855f7;
    --accent-3: #ec4899;
    --glow: rgba(99, 102, 241, 0.3);
    --success: #22c55e;
    --error: #ef4444;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 50%, rgba(168, 85, 247, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 0%, rgba(236, 72, 153, 0.05) 0%, transparent 50%);
}

.container {
    width: 100%;
    max-width: 1200px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 2rem 2.5rem;
    box-shadow: 0 0 40px rgba(99, 102, 241, 0.08), 0 0 80px rgba(168, 85, 247, 0.04);
}

.dash-container {
    width: 100%;
    
}

.hidden { display: none !important; }

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.nav .logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0;
}

.brand {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.accent {
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2), var(--accent-3));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-email {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.admin-link {
    color: var(--accent-1);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--accent-1);
    border-radius: 8px;
    transition: all 0.2s;
}

.admin-link:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-2);
    border-color: var(--accent-2);
}

.ghost-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    width: auto;
}

.ghost-btn:hover {
    border-color: var(--accent-1);
    color: var(--text-primary);
    transform: none;
    box-shadow: none;
}

.btn-sm {
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    color: white;
    border: none;
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.3s;
    font-family: inherit;
    width: auto;
}

.btn-sm:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.hero {
    text-align: center;
    padding: 3rem 0 2rem;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--accent-1);
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.25);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    margin-bottom: 1.5rem;
    width: auto;
}

.hero-title {
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
    margin-bottom: 1rem;
    letter-spacing: -0.03em;
}

.hero-sub {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 520px;
    margin: 0 auto 2rem;
    line-height: 1.65;
}

.hero-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 3rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    color: white;
    border: none;
    padding: 0.8rem 2.25rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.3s;
    font-family: inherit;
    width: auto;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.35), 0 0 40px rgba(99, 102, 241, 0.15);
}

.hero-showcase {
    overflow: hidden;
    position: relative;
    width: 100%;
}

.showcase-track {
    display: flex;
    gap: 1rem;
    animation: scroll 30s linear infinite;
    width: max-content;
}

.showcase-track:hover {
    animation-play-state: paused;
}

@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.showcase-item {
    flex: 0 0 240px;
    border-radius: 14px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border-color);
    transition: transform 0.3s;
}

.showcase-item:hover {
    transform: scale(1.03);
}

.showcase-item img {
    width: 240px;
    height: 240px;
    object-fit: cover;
    display: block;
}

.showcase-item span {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.5rem 0.75rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: left;
}

.section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    max-width: 440px;
    margin: 0 auto;
}

.gallery-section {
    padding: 3rem 0;
    border-top: 1px solid var(--border-color);
}

.gallery-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
}

.gallery-card {
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    transition: transform 0.3s, box-shadow 0.3s;
}

.gallery-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.15);
}

.gallery-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
}

.gallery-info {
    padding: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gallery-tag {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-1);
    background: rgba(99, 102, 241, 0.1);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
}

.gallery-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: right;
}

.features-section {
    padding: 3rem 0;
    border-top: 1px solid var(--border-color);
}

.features-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.feature-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1.5rem;
    transition: border-color 0.3s;
}

.feature-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
}

.feature-card .feature-icon {
    width: 44px;
    height: 44px;
    margin-bottom: 1rem;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-1);
}

.feature-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.feature-card p {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.55;
}



.pm-section {
    padding: 3rem 0;
    border-top: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.pm-section-bg {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(168, 85, 247, 0.08) 0%, transparent 60%),
                radial-gradient(ellipse at 30% 100%, rgba(99, 102, 241, 0.06) 0%, transparent 50%);
    pointer-events: none;
}

.pm-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent-2);
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.25);
    padding: 0.35rem 0.9rem;
    border-radius: 20px;
    margin-bottom: 1rem;
}

.pm-section .section-header h2 {
    font-size: 1.8rem;
}

.pm-section .section-header h2 em {
    font-style: italic;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.pm-section .section-header p {
    max-width: 480px;
}

.pm-demo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.pm-demo-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1rem;
    text-align: center;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.pm-demo-card:hover {
    border-color: rgba(168, 85, 247, 0.3);
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.08);
}

.pm-demo-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.pm-demo-images {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

.pm-demo-images img {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.pm-demo-plus,
.pm-demo-dots {
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 600;
}

.pm-demo-arrow {
    color: var(--accent-1);
    flex-shrink: 0;
    animation: pmArrowPulse 2s ease-in-out infinite;
}

@keyframes pmArrowPulse {
    0%, 100% { transform: translateX(0); opacity: 0.6; }
    50% { transform: translateX(4px); opacity: 1; }
}

.pm-demo-result {
    position: relative;
    width: 200px;
    height: 200px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid var(--border-color);
}

.pm-demo-result img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pm-demo-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.65);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
    padding: 0.75rem;
    backdrop-filter: blur(2px);
}

.pm-demo-result:hover .pm-demo-overlay {
    opacity: 1;
}

.pm-demo-overlay strong {
    color: var(--accent-2);
}

.pm-demo-caption {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.6rem;
}

.pm-demo-caption strong {
    color: var(--accent-1);
}

.pm-steps {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
}

.pm-step {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.pm-step:hover {
    transform: translateY(-4px);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.1);
}

.pm-step-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(168, 85, 247, 0.1));
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-1);
}

.pm-step h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.pm-step p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.55;
}

.pm-step strong {
    color: var(--accent-1);
}

.pm-step em {
    font-style: italic;
    color: var(--text-secondary);
}

.cta-section {
    padding: 2rem 0 0;
}

.cta-card {
    text-align: center;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(168, 85, 247, 0.08));
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 20px;
    padding: 3rem 2rem;
}

.cta-card h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.cta-card p {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.header {
    text-align: center;
    margin-bottom: 2rem;
}

.header .logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.input-group {
    margin-bottom: 1.25rem;
}

.input-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"] {
    width: 100%;
    padding: 0.8rem 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.95rem;
    color: var(--text-primary);
    transition: border-color 0.3s, box-shadow 0.3s;
    font-family: inherit;
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
    text-align: center;
}

input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--glow);
}

textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.95rem;
    color: var(--text-primary);
    resize: vertical;
    min-height: 90px;
    transition: border-color 0.3s, box-shadow 0.3s;
    font-family: inherit;
    line-height: 1.6;
}

textarea:not(:placeholder-shown) {
    text-align: left;
}

textarea:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--glow);
}

.auth-form {
    max-width: 400px;
    margin: 0 auto;
}

.auth-switch {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.auth-switch a {
    color: var(--accent-1);
    text-decoration: none;
}

.auth-switch a:hover { text-decoration: underline; }

button {
    width: 100%;
    padding: 0.8rem;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.3s;
    font-family: inherit;
    text-align: center;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.35), 0 0 40px rgba(99, 102, 241, 0.15);
}

button:active { transform: translateY(0); }
button:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

.dash-container {
    max-width: 1100px;
}

.dash-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 1.5rem;
    align-items: start;
}

.dash-sidebar {
    position: sticky;
    top: 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.25rem;
}

.dash-main {
    min-width: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
}

.credit-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(168, 85, 247, 0.1));
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    text-align: center;
}

.credit-info { margin-bottom: 0.4rem; }

.credit-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.1rem;
}

.credit-amount {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.credit-currency {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-left: 0.15rem;
}

.credit-cost {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.cost-per { color: var(--accent-1); }

.topup-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    padding: 0.45rem 1rem;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    font-size: 0.8rem;
    border-radius: 8px;
}

.debug-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem;
    font-size: 0.75rem;
}

.debug-header {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border-color);
}

.debug-row {
    display: flex;
    justify-content: space-between;
    padding: 0.2rem 0;
}

.debug-label {
    color: var(--text-muted);
}

.debug-value {
    color: var(--text-secondary);
    font-family: monospace;
}

.debug-raw {
    margin-top: 0.4rem;
    padding-top: 0.4rem;
    border-top: 1px solid var(--border-color);
}

.debug-raw summary {
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.7rem;
}

.debug-raw pre {
    margin-top: 0.4rem;
    font-size: 0.65rem;
    color: var(--text-muted);
    max-height: 200px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

.activate-wrap {
    max-width: 400px;
    margin: 0 auto;
}

.activate-card {
    text-align: center;
    padding: 1.5rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    margin-bottom: 1.5rem;
}

.activate-icon {
    color: var(--accent-1);
    margin-bottom: 0.75rem;
}

.activate-card h2 {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.activate-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.activate-form {
    padding: 0;
}

.activate-form .btn-primary {
    display: block;
    width: auto;
    min-width: 200px;
    margin: 0 auto;
}

.free-trial-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.25rem 0;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.free-trial-divider::before,
.free-trial-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.free-trial-section {
    text-align: center;
}

.free-trial-desc {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.free-trial-btn {
    width: auto;
    min-width: 180px;
}

.mode-toggle {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.25rem;
}

.mode-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 0.75rem;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: all 0.2s;
    user-select: none;
}

.mode-option input { display: none; }

.mode-option.active {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.mode-option:hover:not(.active) {
    color: var(--text-secondary);
}

#photoMakerUpload {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.pm-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0.75rem;
    padding: 0.6rem 0.75rem;
    background: rgba(99, 102, 241, 0.08);
    border-left: 3px solid var(--accent-1);
    border-radius: 0 8px 8px 0;
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-muted);
}

.upload-area:hover {
    border-color: var(--accent-1);
    color: var(--text-secondary);
}

.upload-text {
    font-size: 0.88rem;
    margin-top: 0.5rem;
    color: var(--text-secondary);
}

.upload-hint {
    font-size: 0.75rem;
    margin-top: 0.3rem;
    color: var(--text-muted);
}

.image-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.preview-item {
    position: relative;
    width: 70px;
    height: 70px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

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

.preview-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(239,68,68,0.9);
    color: #fff;
    border: none;
    font-size: 12px;
    line-height: 18px;
    text-align: center;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.preview-remove:hover {
    background: var(--error);
    transform: none;
    box-shadow: none;
}

.upload-count {
    width: 100%;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
}

.pm-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
    text-align: center;
    line-height: 1.5;
}

.pm-hint strong {
    color: var(--accent-1);
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 1rem;
    margin-bottom: 0.5rem;
}

.options-grid .input-group { margin-bottom: 0.75rem; }

#imageForm .options-grid:nth-of-type(2) .input-group:last-child {
    grid-column: 1 / -1;
}

#generateBtn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: auto;
    min-width: 180px;
    margin: 0 auto;
    padding: 0.8rem 2rem;
}

.select-wrapper { position: relative; }

select {
    width: 100%;
    padding: 0.7rem 0.9rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.85rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color 0.3s, box-shadow 0.3s;
    appearance: none;
    -webkit-appearance: none;
    font-family: inherit;
}

select:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--glow);
}

.select-arrow {
    position: absolute;
    right: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

#loading {
    text-align: center;
    margin-top: 2rem;
    padding: 2rem;
    background: var(--bg-primary);
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

#loading p { color: var(--text-secondary); margin-top: 1rem; font-size: 0.9rem; }

.loading-steps {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.25rem;
    flex-wrap: wrap;
}

.step {
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 0.3rem 0.65rem;
    border-radius: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

.step.active {
    color: var(--accent-1);
    border-color: var(--accent-1);
    background: rgba(99, 102, 241, 0.1);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.15);
}

.spinner-ring { display: inline-block; position: relative; width: 44px; height: 44px; }
.spinner-ring div {
    box-sizing: border-box; display: block; position: absolute;
    width: 34px; height: 34px; margin: 5px;
    border: 3px solid transparent; border-radius: 50%;
    animation: ring-spin 1.2s cubic-bezier(0.5,0,0.5,1) infinite;
    border-color: var(--accent-1) transparent transparent transparent;
}
.spinner-ring div:nth-child(1) { animation-delay: -0.45s; }
.spinner-ring div:nth-child(2) { animation-delay: -0.3s; }
.spinner-ring div:nth-child(3) { animation-delay: -0.15s; }

@keyframes ring-spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

#result { margin-top: 2rem; }

.result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.result-header h2 { font-size: 1.1rem; color: var(--text-primary); font-weight: 600; }

.badge {
    font-size: 0.75rem; font-weight: 500; padding: 0.25rem 0.75rem;
    border-radius: 20px; background: rgba(34, 197, 94, 0.1);
    color: var(--success); border: 1px solid rgba(34, 197, 94, 0.25);
}

#imagesContainer {
    display: grid;
    gap: 1.5rem;
}

.image-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
}

.image-card img {
    width: 100%;
    display: block;
}

.image-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0.65rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.action-btn {
    flex: 1;
    padding: 0.45rem 0.65rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    width: auto;
    font-family: inherit;
}

.action-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-1);
    color: var(--text-primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}

.action-btn:active { transform: translateY(0); }

.revised-prompt {
    padding: 0.65rem 1rem;
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.8rem;
    border-top: 1px solid var(--border-color);
}

.settings-card {
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

.settings-header {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0;
    gap: 0.75rem;
}

.settings-item + .settings-item {
    border-top: 1px solid var(--border-color);
}

.settings-item-info {
    flex: 1;
    min-width: 0;
}

.settings-item-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
}

.settings-item-desc {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.settings-item .ghost-btn {
    flex-shrink: 0;
    font-size: 0.8rem;
    padding: 0.4rem 0.85rem;
}

.topup-presets {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.preset-btn {
    padding: 0.7rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.preset-btn:hover { border-color: var(--accent-1); background: rgba(99, 102, 241, 0.1); }
.preset-btn.active { border-color: var(--accent-1); background: rgba(99, 102, 241, 0.15); box-shadow: 0 0 12px rgba(99, 102, 241, 0.2); }

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(4px);
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 1.75rem;
    width: 90%;
    max-width: 380px;
    box-shadow: 0 0 60px rgba(99, 102, 241, 0.15);
}

.modal h3 { font-size: 1.2rem; color: var(--text-primary); margin-bottom: 0.4rem; }
.modal-desc { color: var(--text-secondary); font-size: 0.85rem; margin-bottom: 1rem; }

.modal-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.modal-actions .action-btn { flex: 1; padding: 0.7rem; }
.modal-actions .topup-btn { flex: 1; padding: 0.7rem; }

.footer {
    margin-top: 2rem;
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.footer p { color: var(--text-muted); font-size: 0.8rem; }

#toastContainer {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
}

.toast {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 0.8rem 1.2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    animation: slideUp 0.3s ease-out;
    border: 1px solid var(--border-color);
    font-size: 0.85rem;
    min-width: 240px;
    text-align: center;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--error); }

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

.pw-match-indicator {
    display: block;
    font-size: 0.75rem;
    margin-top: 0.3rem;
    min-height: 1.2em;
}

.pw-match-indicator.match { color: var(--success); }
.pw-match-indicator.nomatch { color: var(--error); }

.recovery-codes {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
}

.recovery-code-item {
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--text-primary);
    background: var(--bg-secondary);
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    letter-spacing: 0.05em;
    user-select: all;
}

@media (max-width: 768px) {
    .dash-layout { grid-template-columns: 1fr; }
    .dash-sidebar { position: static; }
    .gallery-grid { grid-template-columns: 1fr 1fr; }
    .features-grid { grid-template-columns: 1fr; }
    .hero-title { font-size: 2rem; }
    .pm-steps { grid-template-columns: 1fr; }
    .pm-demo { flex-direction: column; }
    .pm-demo-arrow { transform: rotate(90deg); }
    .pm-demo-arrow svg { width: 32px; height: 32px; }
    .pm-demo-result { width: 160px; height: 160px; }
}

@media (max-width: 640px) {
    body { padding: 1rem; }
    .container { padding: 1.25rem; border-radius: 16px; }
    .hero-title { font-size: 1.6rem; }
    .gallery-grid { grid-template-columns: 1fr; }
    .showcase-item { flex: 0 0 180px; }
    .showcase-item img { width: 180px; height: 180px; }
    .options-grid { grid-template-columns: 1fr; }
    .nav-email { display: none; }
    .pm-section .section-header h2 { font-size: 1.4rem; }
}
