:root {
    --bg-color: #0f1115;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-glow: #38bdf8;
    --accent-purple: #a855f7;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --panel-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.avatar-menu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0.3rem 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 3rem 1rem;
    overflow-x: hidden;
    position: relative;
}

/* Dynamic Background Blobs */
.background-blob {
    position: absolute;
    filter: blur(120px);
    z-index: -1;
    opacity: 0.4;
    animation: float 20s ease-in-out infinite;
}

.blob-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--accent-purple) 0%, transparent 70%);
    top: -10%;
    left: -10%;
}

.blob-2 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    bottom: -20%;
    right: -10%;
    animation-delay: -10s;
}

@keyframes float {

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

    33% {
        transform: translate(30px, -50px) scale(1.1);
    }

    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

.container {
    width: 100%;
    max-width: 1000px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    z-index: 1;
}

/* Musical staff lines */
.staff-lines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: -1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 2rem;
    gap: 2.5rem;
    padding: 0;
}

.staff-line {
    width: 100%;
    height: 1px;
    background: linear-gradient(to right, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0) 90%);
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: -3rem;
    padding: 0 0.75rem;
    position: relative;
    z-index: 2;
}

h1.glow-text {
    font-family: 'Outfit', sans-serif;
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 0;
    letter-spacing: -0.05em;
}

.wave-letter {
    display: inline-block;
    background: linear-gradient(to bottom, #fff, #a1a1aa);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: blur(0.5px);
    animation: wave 3s ease-in-out infinite;
    animation-delay: calc(var(--i) * 0.15s);
}

@keyframes wave {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.subtitle {
    display: inline-block;
    color: var(--text-secondary);
    font-size: 1.1rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border: 1px solid var(--glass-border);
    padding: 0.5rem 1.2rem;
    border-radius: 999px;
    background: var(--glass-bg);
}

/* Avatar Menu */
.avatar-container {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

.avatar-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--glass-border);
    background: linear-gradient(135deg, var(--accent-glow), #6366f1);
    color: white;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.avatar-btn:hover {
    border-color: var(--accent-glow);
    box-shadow: 0 0 12px rgba(0, 200, 255, 0.3);
}

.avatar-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    min-width: 200px;
    background: rgba(30, 32, 38, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.5rem 0;
    z-index: 100;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.avatar-menu.open {
    display: block;
}

.avatar-menu-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.avatar-menu-name {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.avatar-menu-email {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
}

.avatar-menu-item {
    display: block;
    width: 100%;
    padding: 0.6rem 1rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    font-family: 'Inter', sans-serif;
}

.avatar-menu-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.avatar-menu-item.danger {
    color: #ef4444;
}

.avatar-menu-item.danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Glassmorphism Panels */
.glass-panel {
    background: rgba(30, 32, 38, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: var(--panel-shadow);
    transition: var(--transition-smooth);
}

.glass-panel:hover {
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.7);
}

/* Inputs & Form */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.input-group label {
    font-weight: 500;
    color: #e2e8f0;
    font-size: 1.1rem;
}

textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.25rem;
    color: #fff;
    font-family: inherit;
    font-size: 1.05rem;
    resize: none;
    transition: var(--transition-smooth);
    line-height: 1.5;
}

textarea:focus {
    outline: none;
    border-color: var(--accent-glow);
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.1);
}

textarea::placeholder {
    color: #475569;
}

/* Drop Zone Styles */
.drop-zone {
    width: 100%;
    min-height: 120px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    color: var(--text-secondary);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.2);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.drop-zone--over {
    border-style: solid;
    border-color: var(--accent-glow);
    background: rgba(56, 189, 248, 0.05);
}

.drop-zone__input {
    display: none;
}

.drop-zone__preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

.drop-zone__preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 16px;
}

.remove-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 0, 0, 0.7);
    color: white;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-btn:hover {
    background: rgba(255, 0, 0, 0.9);
    transform: scale(1.1);
}

/* Slider Styles */
.strength-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

#strength-val {
    color: var(--accent-glow);
    font-weight: 600;
}

.custom-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    outline: none;
}

.custom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-glow);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.custom-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* Radio Group */
.radio-group {
    display: flex;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.5rem;
    border-radius: 999px;
    border: 1px solid var(--glass-border);
}

.radio-option {
    position: relative;
    cursor: pointer;
}

.radio-option input[type="radio"] {
    display: none;
}

.radio-label {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.6rem 1rem;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition-smooth);
    background: transparent;
    text-align: center;
}

.radio-option input[type="radio"]:checked+.radio-label {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.3), rgba(168, 85, 247, 0.25));
    color: var(--text-primary);
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.2);
    border: 1px solid rgba(56, 189, 248, 0.4);
}

.radio-option:hover .radio-label {
    color: var(--text-primary);
}

.radio-option.locked .radio-label {
    opacity: 0.3;
    cursor: not-allowed;
}

.radio-option.locked:hover .radio-label {
    opacity: 0.45;
}

/* Controls Row */
.controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2.2rem;
}

/* Toggle Switch */
.toggle-switch {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 0.75rem;
}

.toggle-switch input {
    display: none;
}

.slider {
    position: relative;
    width: 48px;
    height: 24px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    transition: var(--transition-smooth);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.slider:before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-secondary);
    border-radius: 50%;
    transition: .3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

input:checked+.slider {
    background-color: var(--accent-purple);
}

input:checked+.slider:before {
    transform: translateX(24px);
    background-color: #fff;
}

.toggle-label {
    font-size: 0.95rem;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

input:checked~.toggle-label {
    color: var(--text-primary);
}

/* Primary Button */
.primary-btn {
    background: linear-gradient(135deg, var(--accent-glow), var(--accent-purple));
    color: white;
    border: none;
    border-radius: 999px;
    padding: 0.8rem 2rem;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 180px;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(168, 85, 247, 0.4);
    background: linear-gradient(135deg, #7dd3fc, #c084fc);
}

.primary-btn:active {
    transform: translateY(1px);
}

.primary-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Secondary Button */
.secondary-btn {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    padding: 0.8rem 2rem;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 150px;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.35);
    transform: translateY(-2px);
}

.secondary-btn:active {
    transform: translateY(1px);
}

.secondary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Camera Preset Buttons */
.preset-btn {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    padding: 0.35rem 0.85rem;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-smooth);
    white-space: nowrap;
}

.preset-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    color: var(--text-primary);
    border-color: var(--accent-glow);
    transform: translateY(-1px);
}

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

.preset-btn.preset-active {
    background: rgba(var(--accent-glow-rgb, 99, 102, 241), 0.25);
    color: var(--text-primary);
    border-color: var(--accent-glow);
    box-shadow: 0 0 8px rgba(var(--accent-glow-rgb, 99, 102, 241), 0.3);
}

/* Action Icon Button (like Download) */
.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 0.6rem 1rem;
    transition: all 0.2s ease;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--accent-glow);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

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

.action-btn.selected-reference {
    background: rgba(168, 85, 247, 0.4);
    /* accentuate with purple */
    border-color: var(--accent-glow);
    color: #fff;
    box-shadow: 0 0 10px rgba(125, 211, 252, 0.5);
}

.action-btn.selected-reference svg {
    color: var(--accent-glow);
}

/* Loading State */
.btn-loader {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    position: absolute;
}

/* Result Panel */
.result-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    opacity: 1;
    transform: translateY(0);
}

.result-panel.hidden {
    display: none;
    opacity: 0;
    transform: translateY(20px);
}

.image-wrapper {
    position: relative;
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.5);
    min-height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid var(--glass-border);
}

#generated-image {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    transition: opacity 0.5s ease;
}

#generated-image[src=""] {
    opacity: 0;
}

/* Loading Overlay for Image */
.image-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 17, 21, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    z-index: 10;
    transition: opacity 0.3s ease;
}

.image-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--glass-border);
    border-right-color: var(--accent-glow);
    border-bottom-color: var(--accent-purple);
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
}

.status-text {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
    background: linear-gradient(90deg, #fff, #a1a1aa, #fff);
    background-size: 200% auto;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shine 2s linear infinite;
}

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

@keyframes shine {
    to {
        background-position: 200% center;
    }
}

/* Prompt Details */
.prompt-details {
    padding-top: 1.5rem;
    border-top: 1px solid var(--glass-border);
}

.prompt-details h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

#expanded-prompt-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #e2e8f0;
    font-style: italic;
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 12px;
}

/* Utility */
.hidden {
    display: none !important;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

/* Progress Bar */
.progress-container {
    width: 80%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    overflow: hidden;
    margin-top: 1rem;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
    transition: opacity 0.3s ease;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-glow), var(--accent-purple));
    border-radius: 999px;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
}

/* Style selector bar — bleeds to edge of glass panel */
.style-selector-bar {
    display: flex;
    gap: 0;
    /* Extend beyond the 2.5rem panel padding on both sides */
    width: calc(100% + 5rem);
    margin-left: -2.5rem;
    margin-bottom: 1.5rem;
}

.style-selector-bar .style-btn {
    flex: 1;
    padding: 0.7rem 0;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.style-selector-bar .style-btn:first-child {
    border-radius: 24px 0 0 0;
}

.style-selector-bar .style-btn:last-child {
    border-radius: 0 24px 0 0;
}

.style-selector-bar .style-btn.active {
    background: rgba(0, 200, 255, 0.15);
    border-bottom-color: var(--accent-glow);
    color: var(--accent-glow);
}

/* Touch feedback for interactive elements */
@media (hover: none) {
    .gallery-item:active {
        transform: translateY(-2px);
        border-color: var(--accent-glow);
    }

    .action-btn:active {
        background: rgba(255, 255, 255, 0.2);
    }

    .subtitle:active {
        background: rgba(255, 255, 255, 0.1);
    }
}

/* Tablet & small desktop */
@media (max-width: 768px) {
    .blob-1 {
        width: 300px;
        height: 300px;
    }

    .blob-2 {
        width: 350px;
        height: 350px;
    }
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    body {
        padding: 1rem 0.5rem;
    }

    .style-selector-bar {
        width: calc(100% + 2rem);
        margin-left: -1rem;
    }

    /* Tap target sizing for form controls */
    .style-selector-bar .style-btn {
        min-height: 44px;
        font-size: 0.8rem;
    }

    /* Controls area: push below textarea, stack internally
       Scoped to :first-child to avoid affecting #reference-panel */
    #generate-form > .input-group:first-child > div:first-child {
        flex-direction: column !important;
        gap: 0.75rem !important;
        order: 2;
    }

    /* Textarea comes first visually on mobile */
    #prompt-input {
        order: 1;
        min-height: 90px;
    }

    /* Toggles: 2×2 grid so all 4 fit in two compact rows */
    #generate-form > .input-group:first-child > div:first-child > div:first-child {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 0.4rem 1.5rem !important;
        margin-right: 0 !important;
        width: 100%;
    }

    #generate-form > .input-group:first-child > div:first-child > div:first-child > div {
        gap: 1.5rem !important;
    }

    /* Radio groups: keep horizontal, centered, no wrapping */
    #generate-form > .input-group:first-child > div:first-child > div:last-child {
        justify-content: center !important;
        flex-wrap: nowrap !important;
        gap: 0.5rem !important;
        width: 100%;
    }

    /* Radio labels: ensure adequate tap target */
    .radio-label {
        min-height: 44px;
        min-width: 44px;
    }

    /* Action buttons in gallery — larger touch area */
    .action-btn {
        min-height: 44px;
        padding: 0.6rem 0.75rem;
    }

    /* Session header on mobile — reduce padding to prevent overflow */
    .session-title-area {
        min-width: 0;
        overflow: hidden;
    }

    .session-title-area .session-title,
    .session-title-area h3 {
        font-size: 1rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 45vw;
    }

    .session-actions {
        flex-shrink: 0;
        gap: 0.4rem !important;
    }

    header h1.glow-text {
        font-size: 2.5rem;
        flex-direction: column;
        gap: 0.2rem !important;
    }

    header div {
        gap: 1rem !important;
    }

    .subtitle {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }

    .glass-panel {
        padding: 1rem;
        border-radius: 16px;
    }

    .radio-group {
        flex-direction: column;
        border-radius: 12px;
    }

    .radio-label {
        border-radius: 8px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .controls-row {
        flex-direction: column;
        align-items: stretch;
        gap: 1.5rem;
    }

    .controls-row>div {
        flex-direction: column;
        width: 100%;
        gap: 1rem !important;
    }

    .primary-btn,
    .secondary-btn {
        width: 100%;
        min-width: unset;
        margin-left: 0 !important;
    }

    .image-wrapper {
        min-height: 200px;
    }

    .prompt-details {
        padding-top: 1rem;
    }

    #reference-panel>div:last-child {
        flex-direction: column;
        align-items: flex-start;
    }

    .remove-btn {
        width: 44px;
        height: 44px;
        font-size: 1.8rem;
    }

    .avatar-container {
        position: static;
        transform: none;
        display: flex;
        justify-content: center;
        margin-top: 0.5rem;
    }

    #generation-counter {
        position: static !important;
        justify-content: center;
        margin-top: 0.75rem;
    }

    .avatar-btn {
        width: 44px;
        height: 44px;
        font-size: 1rem;
    }

    .avatar-menu {
        right: -1rem;
    }

    .blob-1 {
        width: 200px;
        height: 200px;
    }

    .blob-2 {
        width: 250px;
        height: 250px;
    }

    .toggle-switch {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .modal-prompts {
        max-height: 25vh;
    }

    .modal-prompt-label {
        font-size: 0.75rem;
    }

    .modal-prompt-text {
        font-size: 0.9rem;
    }

    /* Mobile modal — make it scrollable and prevent overflow */
    #image-modal #modal-content {
        max-width: 95vw;
        max-height: 92vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-top: 2.5rem; /* space for close button */
    }

    #image-modal .modal-close {
        position: absolute;
        top: 0.5rem;
        right: 0.5rem;
        font-size: 1.8rem;
        line-height: 1;
        background: rgba(0, 0, 0, 0.5);
        border-radius: 50%;
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding-bottom: 2px;
    }

    #image-modal #modal-image {
        max-height: 55vh;
    }
}

/* Small phones */
@media (max-width: 480px) {
    header h1.glow-text {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 0.75rem;
        padding: 0.35rem 0.6rem;
    }

    body {
        padding: 0.75rem 0.4rem;
    }

    .glass-panel {
        padding: 0.75rem;
    }

    .style-selector-bar {
        width: calc(100% + 1.5rem);
        margin-left: -0.75rem;
    }
}