/* ============================================================
   Virtual Tailor Studio — Style System v4
   Neon Glass · Mobile-first · Glassmorphism · Premium Effects
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Outfit:wght@500;700&display=swap');

/* ── Tokens ─────────────────────────────────────────────── */
:root {
    --bg: #0F0C29;
    --surface: rgba(255, 255, 255, 0.05);
    --bg-glass: rgba(255, 255, 255, 0.06);
    --border: rgba(255, 255, 255, 0.1);
    --border-hl: rgba(162, 89, 255, 0.5);
    --text: #FFFFFF;
    --text-dim: #B0B0C0;
    --accent: #A259FF;
    --accent2: #FF6EC7;
    --accent-gradient: linear-gradient(135deg, #A259FF 0%, #FF6EC7 100%);
    --secondary-bg: rgba(255, 255, 255, 0.08);
    --danger: #FF4B4B;
    --radius: 20px;
    --radius-sm: 14px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --transition: .25s cubic-bezier(.4, 0, .2, 1);
    --font-head: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
}

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

/* ── PARTICLE CANVAS ─────────────────────────────────── */
#particleCanvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.6;
}

/* ── Layout ─────────────────────────────────────────────── */
.app {
    position: relative;
    z-index: 1;
    max-width: 600px;
    margin: 0 auto;
}

/* ── SCREENS ─────────────────────────────────────────── */
.screen {
    display: none;
    padding: 20px 16px;
    animation: fadeIn 0.25s ease;
}

.screen.active {
    display: block;
}

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

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

/* ── Header ─────────────────────────────────────────────── */
.header {
    text-align: center;
    margin-bottom: 20px;
    margin-top: 10px;
}

.header__logo {
    font-family: var(--font-head);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent);
    /* Static color to prevent flickering from gradient animation */
}

.header__tagline {
    color: var(--text-dim);
    font-size: .85rem;
    margin-top: 4px;
}

/* ── BALANCE BADGE ──────────────────────────────────── */
.balance-badge {
    text-align: center;
    background: var(--secondary-bg);
    color: #fff;
    padding: 6px 20px;
    border-radius: 30px;
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0 auto 20px;
    border: 1px solid var(--border-hl);
    width: fit-content;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 16px rgba(162, 89, 255, 0.25);
}

.balance-badge.low {
    border-color: rgba(255, 75, 75, 0.5);
    box-shadow: 0 0 16px rgba(255, 75, 75, 0.2);
}

/* ── Section titles ─────────────────────────────────────── */
.section-title {
    font-family: var(--font-head);
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: inline-block;
    flex-shrink: 0;
}

/* Timer label */
.timer-label {
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: var(--accent);
    background: rgba(162, 130, 255, 0.12);
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid rgba(168, 130, 255, 0.3);
    font-weight: 600;
    min-width: 50px;
    text-align: center;
}

.result-label {
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 600;
    background: rgba(162, 89, 255, 0.1);
    padding: 2px 10px;
    border-radius: 20px;
    border: 1px solid rgba(162, 89, 255, 0.3);
}

/* ── Cards / Glass ──────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding: 20px;
    transition: border-color var(--transition), box-shadow var(--transition);
    position: relative;
    overflow: hidden;
}

.card:hover {
    border-color: var(--border-hl);
    box-shadow: 0 0 0 1px var(--border-hl), var(--shadow);
}

/* ── SHIMMER SWEEP ON CARDS ──────────────────────── */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -120%;
    width: 60%;
    height: 100%;
    background: linear-gradient(105deg,
            transparent 0%,
            rgba(255, 255, 255, 0.03) 40%,
            rgba(255, 255, 255, 0.08) 50%,
            rgba(255, 255, 255, 0.03) 60%,
            transparent 100%);
    transform: skewX(-15deg);
    pointer-events: none;
    z-index: 10;
}

.card:hover::before {
    animation: shimmerSweep 0.75s ease forwards;
}

@keyframes shimmerSweep {
    0% {
        left: -120%;
    }

    100% {
        left: 140%;
    }
}

/* ── UPLOAD ZONE ────────────────────────────────────── */
.upload-section {
    margin-bottom: 24px;
}

.upload-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    text-align: center;
    min-height: 180px;
    padding: 24px 20px;
    border: 2px solid var(--border);
    background: var(--secondary-bg);
    border-radius: var(--radius);
    backdrop-filter: blur(14px);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.upload-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(162, 89, 255, 0.15);
}

.upload-card.has-file {
    border-color: var(--accent);
}

.upload-card input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 5;
}

.upload-card__preview {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
    background-size: cover;
    background-position: center;
}

.upload-card__preview.visible {
    opacity: 1;
}

.upload-card__preview::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 12, 41, 0.7) 0%, transparent 50%);
    border-radius: inherit;
}

.upload-card__content {
    position: relative;
    z-index: 2;
    text-align: center;
    transition: opacity 0.3s;
}

.upload-card.has-file .upload-card__content {
    opacity: 0;
    pointer-events: none;
}

.upload-card__icon {
    font-size: 2.5rem;
    margin-bottom: 8px;
    transition: transform var(--transition);
}

.upload-card:hover .upload-card__icon {
    transform: scale(1.1);
}

.upload-card__label {
    font-size: 0.95rem;
    font-weight: 600;
}

.upload-card__hint {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-top: 6px;
}

.upload-change-hint {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    color: #fff;
    opacity: 0;
    transition: opacity 0.3s;
    white-space: nowrap;
}

.upload-card.has-file:hover .upload-change-hint {
    opacity: 1;
}

/* drag active */
.upload-card.drag-over {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent), inset 0 0 30px rgba(168, 130, 255, .08);
}

/* ── CATEGORY TOGGLE ─────────────────────────────── */
.category-section {
    margin-bottom: 20px;
}

.cat-warning {
    display: none;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: #FFCA28;
    background: rgba(255, 202, 40, 0.1);
    border: 1px solid rgba(255, 202, 40, 0.3);
    border-radius: 10px;
    padding: 8px 12px;
    margin-bottom: 12px;
}

.category-toggle {
    display: flex;
    gap: 10px;
}

.cat-btn {
    flex: 1;
    background: var(--secondary-bg);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 8px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: var(--text);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.cat-btn:hover,
.cat-btn.active {
    border-color: var(--accent);
    background: rgba(162, 89, 255, 0.1);
}

.cat-btn.active {
    box-shadow: 0 0 0 1px var(--accent), 0 4px 20px rgba(162, 89, 255, 0.15);
}

.cat-icon {
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cat-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.cat-label {
    font-size: 0.85rem;
    font-weight: 600;
}

.cat-hint {
    font-size: 0.68rem;
    color: var(--text-dim);
    text-align: center;
    line-height: 1.3;
}

/* ── TEMPLATE SELECTOR ──────────────────────────────── */
.templates-section {
    margin-bottom: 20px;
}

.templates-track {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 1fr;
    gap: 8px;
    padding: 4px 2px 8px;
}



.template-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    height: 100%;
    gap: 6px;
    cursor: pointer;
    background: var(--secondary-bg);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 4px 6px;
    color: var(--text);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    width: 100%;
}

.template-btn:hover {
    border-color: rgba(162, 89, 255, 0.5);
    background: rgba(162, 89, 255, 0.08);
}

.template-btn.active {
    border-color: var(--accent);
    background: rgba(162, 89, 255, 0.12);
    box-shadow: 0 0 0 1px var(--accent), 0 4px 16px rgba(162, 89, 255, 0.2);
}

.template-btn__icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.template-btn__icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.template-btn__name {
    font-size: 0.65rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
    color: var(--text-dim);
}

.template-btn.active .template-btn__name {
    color: var(--accent);
}

/* ── PROFILES CAROUSEL ──────────────────────────────── */
.profiles-section {
    margin-bottom: 20px;
}

.profiles-track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 4px 4px 16px;
    scrollbar-width: none;
}

.profiles-track::-webkit-scrollbar {
    display: none;
}

.profile-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    min-width: 72px;
    flex-shrink: 0;
}

.profile-avatar {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: var(--secondary-bg);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: all 0.25s ease;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
}

.profile-item.active .profile-avatar {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(162, 89, 255, 0.25), 0 0 16px rgba(162, 89, 255, 0.3);
}

.profile-item:hover .profile-avatar {
    transform: scale(1.05);
}

.profile-item span {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-dim);
    text-align: center;
    max-width: 72px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-item.active span {
    color: var(--accent);
    font-weight: 700;
}

.profile-add .profile-avatar {
    border: 2px solid var(--accent);
    background: transparent;
}

.profile-add .profile-avatar span {
    font-size: 1.8rem;
    color: var(--accent);
    font-weight: 300;
}

/* ── PHOTOSESSION SECTION ──────────────────────────── */
.photosession-section {
    margin-bottom: 16px;
}

.photosession-select,
.select-group select {
    width: 100%;
    background: var(--secondary-bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: .9rem;
    outline: none;
    cursor: pointer;
    transition: border-color var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23A259FF' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.photosession-select:focus,
.select-group select:focus {
    border-color: var(--accent);
}

/* ── ACCESSORIES ──────────────────────────────────── */
.accessories-section {
    margin-bottom: 20px;
}

.accessories-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.accessories-label {
    font-size: 0.9rem;
    font-weight: 600;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.checkbox-grid label {
    font-size: .82rem;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 10px 14px;
    background: var(--secondary-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    transition: all var(--transition);
}

.checkbox-grid label:hover {
    background: rgba(162, 89, 255, 0.08);
}

.checkbox-grid input[type="checkbox"] {
    accent-color: var(--accent);
}

.checkbox-grid label:has(input:checked) {
    border-color: var(--accent);
    background: rgba(162, 89, 255, 0.1);
    color: #fff;
}

/* ── GENERATE BUTTON ─────────────────────────────────── */
.generate-section {
    margin-bottom: 24px;
}

.btn--generate {
    padding: 18px;
    font-size: 1.05rem;
    position: relative;
    overflow: hidden;
}

.btn--generate:not(:disabled)::after {
    content: '';
    position: absolute;
    inset: -2px;
    background: var(--accent-gradient);
    border-radius: inherit;
    opacity: 0;
    animation: pulseGlow 2s infinite;
    z-index: -1;
}

@keyframes pulseGlow {

    0%,
    100% {
        opacity: 0;
        transform: scale(1);
    }

    50% {
        opacity: 0.4;
        transform: scale(1.03);
    }
}

/* Cancel button */
.btn--cancel {
    background: rgba(255, 75, 75, 0.1);
    color: #FF6B6B;
    border: 1px solid rgba(255, 75, 75, 0.3);
    border-radius: var(--radius-sm);
    padding: 14px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    width: 100%;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn--cancel:hover {
    background: rgba(255, 75, 75, 0.18);
}

/* ── PREVIEW / RESULT ────────────────────────────────── */
.preview {
    display: none;
    margin-bottom: 24px;
}

.preview.active {
    display: block;
}

.preview__header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.result-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.canvas-wrap {
    display: block;
    position: relative;
    min-height: 260px;
    overflow: hidden;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100%;
    margin: 0 auto;
    border-radius: var(--radius);
    background: var(--secondary-bg);
}

.canvas-placeholder {
    color: var(--text-dim);
    font-size: 0.85rem;
    text-align: center;
    padding: 40px 20px;
    line-height: 1.7;
}

/* ── SCAN ANIMATION ──────────────────────────────────── */
.scan-animation {
    position: absolute;
    inset: 0;
    background: rgba(10, 7, 30, 0.75);
    backdrop-filter: blur(4px);
    z-index: 10;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
    gap: 16px;
}

.scan-animation.active {
    display: flex;
}

.scan-line {
    position: absolute;
    width: 100%;
    height: 2px;
    background: linear-gradient(to right, transparent, var(--accent2), var(--accent), var(--accent2), transparent);
    box-shadow: 0 0 20px 6px rgba(255, 110, 199, 0.6);
    animation: scan 2.5s infinite ease-in-out;
}

.scan-text {
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-head);
    animation: pulse 1s infinite alternate;
    text-shadow: 0 0 20px rgba(162, 89, 255, 0.8);
    z-index: 1;
}

@keyframes scan {
    0% {
        top: 5%;
    }

    50% {
        top: 95%;
    }

    100% {
        top: 5%;
    }
}

@keyframes pulse {
    from {
        opacity: 0.7;
    }

    to {
        opacity: 1;
    }
}

/* ── RESULT IMAGE ─────────────────────────────────────── */
.result-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius);
    animation: cinematicReveal 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* ── CINEMATIC REVEAL ────────────────────────────────── */
@keyframes cinematicReveal {
    0% {
        opacity: 0;
        filter: blur(14px) brightness(1.6);
        transform: scale(0.95);
    }

    60% {
        filter: blur(3px) brightness(1.05);
    }

    100% {
        opacity: 1;
        filter: blur(0) brightness(1);
        transform: scale(1);
    }
}

/* ── RESULT ACTIONS ──────────────────────────────────── */
.result-actions {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.result-actions__row {
    display: flex;
    gap: 10px;
}

.result-actions__row .btn {
    flex: 1;
    font-size: 0.9rem;
    padding: 13px 8px;
}

/* ── BUTTONS ─────────────────────────────────────────── */
.btn {
    width: 100%;
    padding: 16px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.btn:active {
    transform: scale(0.97);
}

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

.btn--accent {
    background: var(--accent-gradient);
    color: #fff;
    border: none;
    box-shadow: 0 4px 20px rgba(162, 89, 255, 0.35);
}

.btn--accent:hover {
    box-shadow: 0 6px 28px rgba(162, 89, 255, 0.5);
    transform: translateY(-1px);
}

.btn--primary {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn--primary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn--secondary {
    background: var(--secondary-bg);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn--secondary:hover {
    background: rgba(255, 255, 255, 0.12);
}

.btn--reset {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-dim);
    border: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.85rem;
    font-weight: 400;
}

.btn--reset:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.15);
}

/* ── RIPPLE ON BUTTONS ───────────────────────────────── */
.btn .ripple {
    position: absolute;
    border-radius: 50%;
    width: 10px;
    height: 10px;
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: rippleAnim 0.6s linear forwards;
    pointer-events: none;
}

@keyframes rippleAnim {
    to {
        transform: scale(40);
        opacity: 0;
    }
}

/* ── NAVIGATION ──────────────────────────────────────── */
.nav-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
    z-index: 100;
    background: rgba(15, 12, 41, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.nav-item {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    color: var(--text-dim);
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 20px;
    border-radius: 12px;
    position: relative;
    transition: color 0.2s ease;
}

.nav-icon {
    font-size: 1.3rem;
    transition: transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-img {
    width: 26px;
    height: 26px;
    object-fit: contain;
}

.nav-item.active {
    color: var(--accent);
}

.nav-item.active .nav-icon {
    transform: scale(1.15);
    filter: drop-shadow(0 0 8px var(--accent));
}

.nav-item::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 24px;
    height: 3px;
    background: var(--accent);
    border-radius: 4px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 -2px 10px rgba(162, 89, 255, 0.5);
}

.nav-item.active::after {
    transform: translateX(-50%) scaleX(1);
}

.nav-badge {
    position: absolute;
    top: 0;
    right: 8px;
    background: var(--accent);
    color: white;
    border-radius: 10px;
    font-size: 0.65rem;
    padding: 1px 5px;
    font-weight: 700;
}

/* ── GALLERY (Wardrobe Screen) ────────────────────────── */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 4px 0;
}

.gallery-item {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    aspect-ratio: 3/4;
    background: var(--secondary-bg);
    cursor: pointer;
    transition: transform 0.2s ease;
    border: 1px solid var(--border);
}

.gallery-item:hover {
    transform: scale(1.02);
}

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

.gallery-item__overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(15, 12, 41, 0.85) 0%, transparent 100%);
    padding: 12px 10px 8px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.gallery-item__name {
    font-size: 0.78rem;
    font-weight: 600;
    color: #fff;
}

.gallery-item__date {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.6);
}

.gallery-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-dim);
    grid-column: 1/-1;
}

.gallery-empty p {
    margin-top: 12px;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ── FAMILY / PROFILES SCREEN ────────────────────────── */
.family-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.family-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    background: var(--secondary-bg);
    border: 1px solid var(--border);
}

.family-card__avatar {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--accent);
    flex-shrink: 0;
}

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

.family-card__info {
    flex: 1;
}

.family-card__name {
    font-weight: 700;
    font-size: 1rem;
}

.family-card__default {
    font-size: 0.75rem;
    color: var(--accent);
    margin-top: 2px;
}

.family-card__actions {
    display: flex;
    gap: 8px;
}

.family-card__actions button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.family-card__actions button:hover {
    opacity: 1;
}

/* ── MODAL / BOTTOM SHEET ────────────────────────────── */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 900;
    display: none;
    align-items: flex-end;
    justify-content: center;
}

.modal-overlay.show {
    display: flex;
}

.bottom-sheet {
    width: 100%;
    max-width: 600px;
    background: rgba(20, 16, 45, 0.98);
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 24px;
    border: 1px solid var(--border);
    border-bottom: none;
    animation: slideUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

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

.close-modal {
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--text-dim);
    cursor: pointer;
}

/* Profile upload in modal */
.profile-upload {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: var(--secondary-bg);
    border: 2px solid var(--border);
    margin: 0 auto 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.3s;
}

.profile-upload:hover {
    border-color: var(--accent);
}

.profile-upload input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.profile-upload__icon {
    font-size: 2rem;
}

.profile-upload__text {
    font-size: 0.7rem;
    color: var(--text-dim);
    text-align: center;
    margin-top: 4px;
}

.profile-hint {
    background: rgba(162, 89, 255, 0.08);
    border: 1px solid rgba(162, 89, 255, 0.2);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.8rem;
    color: var(--text-dim);
    line-height: 1.5;
    margin-bottom: 16px;
}

.input-group {
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.input-group input {
    width: 100%;
    padding: 15px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    transition: border-color 0.2s;
}

.input-group input:focus {
    border-color: var(--accent);
    outline: none;
    background: rgba(255, 255, 255, 0.08);
}

/* ── TOAST ──────────────────────────────────────────────── */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: var(--accent-gradient);
    color: white;
    padding: 12px 20px;
    max-width: calc(100vw - 40px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-radius: 30px;
    font-weight: 500;
    font-size: 0.9rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 2000;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 480px) {
    .category-toggle {
        gap: 8px;
    }

    .cat-btn {
        padding: 12px 4px 10px;
    }

    .cat-img {
        width: 32px;
        height: 32px;
    }

    .cat-label {
        font-size: 0.78rem;
    }

    .cat-hint {
        font-size: 0.62rem;
    }

    .header__logo {
        font-size: 1.55rem;
    }

    .upload-card {
        min-height: 150px;
    }
}

@media (min-width: 768px) {
    .app {
        padding: 0 0;
    }

    .header__logo {
        font-size: 2.2rem;
    }
}