/* ===== Modal ===== */
.modal {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.85);
    display: flex; align-items: center; justify-content: center;
    z-index: 100;
}
.modal-content {
    background: #1a1a1a; border: 1px solid #333; border-radius: 12px;
    padding: 40px; max-width: 400px; width: 90%; text-align: center;
}
.modal-wide { max-width: 500px; }
.modal-content h2 { font-size: 24px; margin-bottom: 16px; }
.modal-content p { color: #888; margin-bottom: 24px; font-style: italic; }
.modal-content label { display: block; text-align: left; font-size: 13px; color: #999; margin-bottom: 6px; }
.modal-content input[type="text"],
.modal-content input[type="password"] {
    width: 100%; padding: 12px; background: #111; border: 1px solid #333;
    border-radius: 8px; color: #fff; font-size: 14px; margin-bottom: 16px; outline: none;
}
.modal-content input:focus { border-color: #666; }
.modal-content button {
    width: 100%; padding: 12px; background: #fff; color: #000; border: none;
    border-radius: 8px; font-size: 15px; font-weight: 600; cursor: pointer; transition: opacity 0.2s;
}
.modal-content button:hover { opacity: 0.85; }
.btn-secondary { background: transparent !important; color: #888 !important; border: 1px solid #333 !important; margin-top: 8px; }
.btn-secondary:hover { color: #fff !important; border-color: #555 !important; }
.api-link { display: block; margin-top: 12px; color: #666; font-size: 13px; text-decoration: none; }
.api-link:hover { color: #999; }

/* ===== Google Sign In Button ===== */
.btn-google {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #fff !important;
    color: #333 !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    padding: 12px 24px !important;
    border-radius: 8px !important;
    border: 1px solid #ddd !important;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-google:hover {
    background: #f5f5f5 !important;
    border-color: #ccc !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.btn-google svg {
    flex-shrink: 0;
}

/* ===== Save Overwrite ===== */
#save-overwrite-list { margin-bottom: 16px; max-height: 200px; overflow-y: auto; }
.overwrite-label { font-size: 12px; color: #666; margin-bottom: 8px !important; font-style: normal !important; }
.overwrite-btn {
    width: 100%; padding: 8px 12px !important; background: transparent !important; color: #aaa !important;
    border: 1px solid #333 !important; border-radius: 6px !important; font-size: 13px !important;
    font-weight: 400 !important; margin-bottom: 4px; text-align: left !important; cursor: pointer;
}
.overwrite-btn:hover { background: #222 !important; color: #fff !important; border-color: #555 !important; }

/* ===== Gallery ===== */
#gallery-list { max-height: 400px; overflow-y: auto; margin-bottom: 16px; }
.gallery-empty { color: #666; padding: 40px 0; font-style: italic; }
.gallery-item { display: flex; align-items: center; justify-content: space-between; padding: 12px; border-bottom: 1px solid #222; }
.gallery-item:last-child { border-bottom: none; }
.gallery-item-info { display: flex; flex-direction: column; gap: 4px; text-align: left; flex: 1; min-width: 0; }
.gallery-item-name { font-size: 14px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gallery-item-date { font-size: 11px; color: #666; }
.gallery-item-actions { display: flex; gap: 8px; flex-shrink: 0; }
.gallery-load { padding: 6px 14px !important; font-size: 12px !important; width: auto !important; border-radius: 6px !important; }
.gallery-delete { padding: 6px 10px !important; font-size: 12px !important; width: auto !important; border-radius: 6px !important; background: transparent !important; color: #666 !important; border: 1px solid #333 !important; }
.gallery-delete:hover { color: #e06c75 !important; border-color: #e06c75 !important; }

/* ===== User Info in Hamburger Menu ===== */
.menu-divider {
    height: 1px;
    background: #333;
    margin: 6px 0;
}
#user-info-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
}
.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
#user-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}
#user-name {
    font-size: 13px;
    color: #ddd;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
#user-email {
    font-size: 11px;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
#plan-badge {
    font-size: 9px;
    font-weight: 700;
    font-family: monospace;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    border-radius: 4px;
    background: #333;
    color: #888;
    flex-shrink: 0;
}
.plan-free {
    background: #333;
    color: #888;
}
.plan-pro {
    background: rgba(79, 195, 247, 0.15);
    color: #4fc3f7;
}
.plan-max {
    background: rgba(255, 213, 79, 0.15);
    color: #ffd54f;
}

/* ===== Model Tier Lock ===== */
.model-lock {
    font-size: 12px;
    margin-left: 4px;
}
.model-opt.locked {
    opacity: 0.4;
    cursor: not-allowed;
}