* { box-sizing: border-box; margin: 0; padding: 0; }
html {
    overflow-anchor: none; /* evita que el navegador “corrija” el scroll y mueva la zona de arriba al cambiar la galería */
    scrollbar-gutter: stable;
}
body { font-family: 'Inter', sans-serif; background: #fdfdfd; min-height: 100vh; display: flex; flex-direction: column; }
main { overflow-anchor: none; }
.body-center { align-items: center; justify-content: center; height: 100vh; }

/* Header */
header { background: #fff; border-bottom: 1px solid #eee; position: sticky; top: 0; z-index: 1000; padding: 0 20px; height: 70px; display: flex; align-items: center; }
.header-content { display: flex; align-items: center; width: 100%; justify-content: space-between; }
.header-left { display: flex; align-items: center; }
header img { height: 30px; width: auto; display: block; }
.brand-title { font-weight: 900; text-transform: uppercase; font-size: 10px; letter-spacing: 1px; margin-left: 12px; padding-left: 12px; border-left: 2px solid #eee; height: 30px; display: flex; align-items: center; line-height: 1; }

.header-nav { display: flex; align-items: center; gap: 10px; }
.welcome-text { font-size: 12px; color: #888; margin-right: 8px; }
.welcome-text strong { color: #000; }
.nav-icon { text-decoration: none; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; background: #f8f8f8; border-radius: 50%; color: #000; font-size: 16px; transition: 0.2s; flex-shrink: 0; }
.nav-icon:hover { background: #000; color: #fff; }
.user-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; margin-right: 5px; }
.user-avatar-placeholder { width: 36px; height: 36px; border-radius: 50%; background: #000; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; margin-right: 5px; }

/* Upload Section */
.upload-section {
    padding: 30px 0;
    background: #fff;
    border-bottom: 1px solid #eee;
    contain: layout style; /* el layout del formulario no depende de cambios bajo la galería */
    overflow-anchor: none;
}
.container-small { max-width: 1100px; margin: 0 auto; padding: 0 20px; width: 100%; }
.upload-form { }

/* Form Columns */
.form-columns { display: flex; gap: 25px; }
.column-left { flex: 1.5; }
.column-right { flex: 1; }

/* Main Content */
.main-content { padding: 30px 0; background: #fdfdfd; }
.main-container { max-width: 1600px; margin: 0 auto; padding: 0 20px; width: 100%; }

/* Search */
form.search-bar-full,
.search-bar-full { margin-bottom: 15px; position: relative; z-index: 5; overflow: visible; min-height: 52px; }
.search-input-full { width: 100%; padding: 14px 20px; border: 1px solid #eee; border-radius: 12px; background: #fff; font-size: 14px; outline: none; position: relative; z-index: 101; vertical-align: top; }
.search-input-full:focus { border-color: #000; }

/* Tags Row */
.tags-row { display: flex; gap: 8px; flex-wrap: nowrap; overflow: hidden; margin-bottom: 25px; }
.filter-pill { background: #fff; border: 1px solid #eee; padding: 8px 14px; border-radius: 20px; font-size: 11px; font-weight: 600; cursor: pointer; transition: 0.2s; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.filter-pill:hover { background: #000; color: #fff; border-color: #000; }
.filter-pill.active { background: #000; color: #fff; border-color: #000; }
.tag-count { background: rgba(0,0,0,0.1); padding: 2px 6px; border-radius: 10px; font-size: 9px; font-weight: 700; }
.filter-pill.active .tag-count { background: rgba(255,255,255,0.2); }

/* Gallery */
.gallery-section { width: 100%; }
.gallery {
    column-count: 5;
    column-gap: 15px;
    width: 100%;
    overflow-anchor: none; /* menos saltos de scroll al cambiar alturas al cargar imágenes */
}
.gallery-card { break-inside: avoid; background: #fff; border: 1px solid #eee; margin-bottom: 15px; border-radius: 12px; position: relative; overflow: hidden; }
/* Hueco fijo antes de que cargue la imagen (evita CLS y reflow en columnas) */
.gallery-card__thumb {
    width: 100%;
    aspect-ratio: 1;
    min-height: 80px;
    background: #ececec;
    overflow: hidden;
}
.gallery-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    cursor: pointer;
}
.material-symbols-rounded { font-family: 'Material Symbols Rounded'; font-weight: normal; font-style: normal; font-size: 24px; line-height: 1; letter-spacing: normal; text-transform: none; display: inline-block; white-space: nowrap; word-wrap: normal; direction: ltr; -webkit-font-smoothing: antialiased; }

/* Altura fija: muchos tags ya no estiran la tarjeta (columnas más regulares) */
.tags-preview {
    padding: 8px 10px;
    font-size: 9px;
    line-height: 1.45;
    color: #bbb;
    text-transform: uppercase;
    box-sizing: border-box;
    min-height: 42px;
    max-height: 42px;
    overflow: hidden;
    word-break: break-word;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

/* Textarea & Inputs */
textarea { width: 100%; height: 380px; padding: 20px; border: 1px solid #ddd; border-radius: 12px; resize: vertical; font-family: monospace; font-size: 14px; outline: none; min-height: 150px; max-height: 500px; }
.upload-form .column-left textarea { height: 260px; max-height: 420px; }
/* Prompt principal: altura fija + scroll interno (evita que al redimensionar/escribir mueva toda la página) */
#prompt-text {
    resize: none;
    overflow-y: auto;
    min-height: 260px;
    max-height: 420px;
    height: 260px;
}
.prompt-tools { margin-top: 12px; }
.template-buttons { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 15px; }
.tool-label { font-size: 10px; font-weight: 700; text-transform: uppercase; color: #999; }
.tpl-btn { background: #f5f5f5; border: 1px solid #eee; padding: 5px 10px; border-radius: 6px; font-size: 10px; cursor: pointer; font-family: monospace; transition: 0.2s; }
.tpl-btn:hover { background: #000; color: #fff; border-color: #000; }

/* AI pills (compatibilidad) */
.ai-pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 15px; }
.ai-pill {
    background: #fff;
    border: 1px solid #ddd;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    color: #444;
    font-family: inherit;
}
.ai-pill:hover { border-color: #000; color: #000; }
.ai-pill.ai-pill--active {
    background: #000;
    color: #fff;
    border-color: #000;
}

/* Parámetros referencia Midjourney */
.param-ref-intro { font-size: 11px; color: #777; line-height: 1.45; margin: -4px 0 10px 0; }
.param-ref-scroll {
    max-height: 340px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 14px 14px 8px;
    margin-bottom: 18px;
    background: #fafafa;
}
.param-cat { margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid #eee; }
.param-cat:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.param-cat-title { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; color: #777; margin-bottom: 6px; }
.param-cat-desc { font-size: 11px; color: #666; line-height: 1.45; margin-bottom: 8px; }
.param-cat-desc code { font-size: 10px; background: #eee; padding: 1px 5px; border-radius: 4px; font-family: ui-monospace, monospace; }
.param-snippet-row { display: flex; flex-wrap: wrap; gap: 6px; }
.param-snippet {
    font-size: 10px;
    font-family: ui-monospace, monospace;
    padding: 6px 10px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #ddd;
    cursor: pointer;
    transition: 0.15s;
    color: #222;
}
.param-snippet:hover { background: #000; color: #fff; border-color: #000; }
.param-block-label { margin-top: 18px; }
.column-left .param-ref-scroll { max-height: 280px; }

/* Referencias múltiples (upload) */
.drop-zone--multi {
    min-height: 100px;
    height: auto;
    padding: 10px;
    flex-wrap: wrap;
    align-content: flex-start;
    align-items: flex-start;
}
.drop-zone--multi.drop-zone--filled {
    border-style: solid;
    border-color: #ccc;
}
.ref-previews-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
    position: relative;
    z-index: 2;
}
.ref-preview-thumb {
    position: relative;
    width: 72px;
    height: 56px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #eee;
    flex-shrink: 0;
}
.ref-preview-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.ref-thumb-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,0.65);
    color: #fff;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.ref-thumb-remove:hover { background: #000; }

/* Modal referencias múltiples */
.modal-ref-multi-wrap {
    background: #1a1a1a;
    padding: 12px 14px;
    flex-shrink: 0;
    width: 100%;
}
.modal-ref-label {
    font-size: 9px;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}
.modal-ref-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.modal-ref-item {
    position: relative;
    display: block;
    width: 100px;
    height: 76px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}
.modal-ref-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.modal-ref-open {
    position: absolute;
    bottom: 4px;
    right: 4px;
    color: #fff;
    font-size: 14px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}
.notes-input { height: 60px !important; resize: none !important; background: #f9f9f9 !important; border: 1px solid #eee !important; border-radius: 8px !important; font-family: 'Inter', sans-serif !important; font-size: 13px !important; padding: 12px !important; }
.input-field, .search-input { width: 100%; padding: 14px; border: 1px solid #eee; border-radius: 8px; background: #f9f9f9; margin-bottom: 10px; font-size: 14px; outline: none; }
label { display: block; font-size: 10px; font-weight: 800; text-transform: uppercase; margin-bottom: 8px; color: #777; }
label.privacy-check-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    cursor: pointer;
}
label.privacy-check-label input[type="checkbox"] {
    width: auto;
    margin: 0;
    flex-shrink: 0;
}

/* Tags Container */
.tags-input-wrapper { position: relative; }
.tag-suggestions { display: none; position: absolute; top: 100%; left: 0; right: 0; background: #fff; border: 1px solid #eee; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); z-index: 1000; max-height: 200px; overflow-y: auto; pointer-events: auto; }
.tag-suggestions.active { display: block; }
.tag-suggestion { padding: 10px 14px; cursor: pointer; font-size: 13px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #f5f5f5; }
.tag-suggestion:last-child { border-bottom: none; }
.tag-suggestion:hover { background: #f5f5f5; }
.tag-suggestion span { color: #888; font-size: 11px; }

.tag-container { margin: 5px 0 15px 0; display: flex; gap: 6px; flex-wrap: wrap; }
.tag-pill { background: #eee; padding: 5px 12px; border-radius: 20px; font-size: 10px; cursor: pointer; font-weight: bold; transition: 0.2s; }
.tag-pill:hover { background: #000; color: #fff; }

.modal-tags-display { margin-bottom: 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.modal-tag-pill { background: #e0e0e0; padding: 4px 10px; border-radius: 12px; font-size: 11px; display: inline-block; }

/* Dropzone */
.drop-zone { height: 110px; border: 2px dashed #eee; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: #fafafa; cursor: pointer; margin-bottom: 10px; transition: 0.3s; position: relative; overflow: hidden; }
.drop-zone:hover, .drop-zone--over { border-color: #000; background: #f0f0f0; }
.drop-zone__prompt { font-size: 11px; color: #aaa; font-weight: bold; text-transform: uppercase; text-align: center; }
.drop-zone__input { display: none; }
.img-preview { position: absolute; top: 0; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: center; background: #fff; }
.img-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.remove-img-btn { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,0.7); color: #fff; border: none; width: 24px; height: 24px; border-radius: 50%; font-size: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.remove-img-btn:hover { background: #000; }
.ref-preview { height: 70px !important; }

/* Botón */
.btn-black { background: #000 !important; color: #fff !important; border: none; padding: 18px; border-radius: 8px; width: 100%; font-weight: bold; cursor: pointer; text-transform: uppercase; font-size: 11px; letter-spacing: 1px; }
.btn-eye { position: absolute; right: 12px; bottom: 24px; font-size: 9px; cursor: pointer; font-weight: bold; color: #aaa; text-transform: uppercase; }

/* Login */
.login-box { background: #fff; border: 1px solid #eee; padding: 40px; border-radius: 20px; width: 360px; text-align: center; }

/* Modal */
#modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.95); z-index: 2000; align-items: center; justify-content: center; padding: 20px; }
.modal-content { display: flex; background: #fff; width: 100%; max-width: 1600px; height: 95vh; border-radius: 20px; overflow: hidden; }
.modal-images { flex: 1.8; background: #111; display: flex; flex-direction: column; padding: 10px; }
.modal-img-container { flex: 1; position: relative; display: flex; align-items: center; justify-content: center; padding: 10px; min-height: 0; }
#mimg-link { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.modal-main-img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }
.img-overlay { position: absolute; top: 10px; left: 10px; right: 10px; bottom: 10px; background: rgba(0,0,0,0.2); border-radius: 8px; display: flex; align-items: center; justify-content: center; opacity: 0; transition: 0.2s; }
.img-overlay span { color: #fff; font-size: 40px; }
#mimg-link:hover .img-overlay { opacity: 1; }

.modal-ref-container { background: #1a1a1a; padding: 10px 12px; flex-shrink: 0; display: flex; gap: 12px; align-items: center; }
.ref-img-wrapper { position: relative; flex-shrink: 0; }
#mref-link { display: block; position: relative; }
.modal-ref-img { width: 80px; height: 60px; object-fit: cover; border-radius: 6px; display: block; }
.ref-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); border-radius: 6px; display: flex; align-items: center; justify-content: center; opacity: 0; transition: 0.2s; }
.ref-overlay span { color: #fff; font-size: 16px; }
#mref-link:hover .ref-overlay { opacity: 1; }
.modal-ref-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ref-label { color: #888; font-size: 9px; text-transform: uppercase; }
.ref-url-link { display: block; color: #666; font-size: 9px; word-break: break-all; text-decoration: none; }
.ref-url-link:hover { color: #fff; }

.modal-right { flex: 1; padding: 25px; display: flex; flex-direction: column; overflow-y: auto; min-width: 350px; max-width: 500px; position: relative; }
.modal-details-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; min-height: 36px; gap: 12px; flex-shrink: 0; }
.modal-details-header h3 { flex: 1; }
.modal-details-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.modal-fav-btn,
.modal-icon-btn {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    margin: 0;
    line-height: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.modal-fav-btn:hover,
.modal-icon-btn:hover { background: #f0f0f0; }
.modal-fav-btn .material-symbols-rounded,
.modal-icon-btn .material-symbols-rounded { font-size: 22px; color: #ccc; }
#modal-share-icon { color: #666; }
.modal-privacy-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    flex-shrink: 0;
}
.modal-privacy-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    background: #e8f5e9;
    color: #2e7d32;
}
.modal-privacy-badge--private {
    background: #fce4ec;
    color: #c2185b;
}
.btn-privacy-toggle {
    font-size: 11px;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #ddd;
    background: #fff;
    cursor: pointer;
    color: #333;
}
.btn-privacy-toggle:hover { background: #f5f5f5; }
#mprompt { flex-grow: 1; background: #f8f8f8; padding: 20px; border-radius: 10px; overflow-y: auto; white-space: pre-wrap; word-wrap: break-word; font-family: monospace; border: 1px solid #eee; margin-bottom: 15px; font-size: 13px; min-height: 100px; }
#mtags-display { margin-bottom: 10px; }
#mtags-edit { display: none; margin-bottom: 10px; }
#mtags-input { width: 100%; margin-bottom: 8px; }
#mbtn-edit-tags { margin-bottom: 15px; }
#mnotes-section { display: none; margin-bottom: 15px; }
#mnotes { background: #f8f8f8; padding: 12px; border-radius: 8px; font-size: 12px; color: #666; margin-top: 5px; }
#murl-section { display: none; margin-bottom: 15px; }
#murl { font-size: 11px; color: #000; word-break: break-all; }

/* Footer */
footer { padding: 30px 20px; text-align: center; border-top: 1px solid #eee; font-size: 12px; color: #888; }
.footer-link { color: #000; font-weight: 700; text-decoration: none; }
.footer-link:hover { text-decoration: underline; }

/* Go Top */
.go-top-btn { position: fixed; bottom: 30px; right: 30px; background: #000; color: #fff; width: 45px; height: 45px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; text-decoration: none; z-index: 999; transition: 0.3s; box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
.go-top-btn:hover { background: #333; transform: translateY(-3px); }

/* Loader / estado carga infinita galería */
.loader { text-align: center; padding: 20px; color: #888; font-size: 12px; }

.gallery-load-sentinel {
    height: 2px;
    width: 100%;
    pointer-events: none;
    opacity: 0;
}
.gallery-load-status {
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 16px;
    box-sizing: border-box;
    text-align: center;
    border-top: 1px solid transparent;
}
.gallery-load-message {
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
    color: #999;
    max-width: 420px;
}
.gallery-load-status--loading .gallery-load-message {
    color: #555;
}
.gallery-load-status--loading .gallery-load-message::before {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 8px;
    border: 2px solid #ddd;
    border-top-color: #333;
    border-radius: 50%;
    vertical-align: -2px;
    animation: gallery-spin 0.7s linear infinite;
}
@keyframes gallery-spin {
    to { transform: rotate(360deg); }
}
.gallery-load-status--done .gallery-load-message { color: #666; }
.gallery-load-status--end .gallery-load-message { color: #aaa; }

/* Buscador: lista flotante (fixed) — no altera altura del bloque de upload ni del main */
#search-suggestions.search-suggestions-dropdown {
    display: none;
    position: fixed;
    box-sizing: border-box;
    z-index: 10050;
    margin: 0;
    padding: 0;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    max-height: 200px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
#search-suggestions.search-suggestions-dropdown .tag-suggestion { border-bottom: 1px solid #f5f5f5; }
#search-suggestions.search-suggestions-dropdown .tag-suggestion:last-child { border-bottom: none; }
#search-suggestions.search-suggestions-dropdown .tag-suggestion:hover,
#search-suggestions.search-suggestions-dropdown .tag-suggestion.is-active { background: #f0f0f0; }

/* Modal · editar tags: mismas sugerencias (encima del modal z-index 2000) */
#mtag-suggestions.mtag-suggestions-dropdown {
    display: none;
    position: fixed;
    box-sizing: border-box;
    z-index: 10060;
    margin: 0;
    padding: 0;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    max-height: 200px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
#mtag-suggestions.mtag-suggestions-dropdown .tag-suggestion { border-bottom: 1px solid #f5f5f5; }
#mtag-suggestions.mtag-suggestions-dropdown .tag-suggestion:last-child { border-bottom: none; }
#mtag-suggestions.mtag-suggestions-dropdown .tag-suggestion:hover,
#mtag-suggestions.mtag-suggestions-dropdown .tag-suggestion.is-active { background: #f0f0f0; }

/* Admin buttons */
.admin-btn { display: inline-flex !important; align-items: center !important; justify-content: center !important; width: 60px !important; height: 36px !important; border-radius: 6px !important; cursor: pointer; font-size: 12px !important; font-family: 'Inter', sans-serif !important; font-weight: 500; border: none !important; }
.admin-btn-black { background: #333 !important; color: #fff !important; }
.admin-btn-black:hover { background: #555 !important; }
.admin-btn-icon { width: 36px !important; font-size: 16px !important; }
.admin-form { display: inline-flex !important; align-items: center !important; }
.admin-label { display: inline-flex !important; align-items: center !important; justify-content: center !important; }

/* Responsive */
@media (max-width: 1200px) {
    .gallery { column-count: 4; }
}

@media (max-width: 1024px) {
    .gallery { column-count: 3; }
}

@media (max-width: 768px) {
    header { padding: 0 15px; height: 60px; }
    header img { height: 25px; }
    .brand-title { font-size: 9px; margin-left: 8px; padding-left: 8px; }
    .welcome-text { display: none; }
    
    .form-columns { flex-direction: column; gap: 20px; }
    .column-left, .column-right { flex: none; width: 100%; }
    .container-small { padding: 0 15px; }
    .upload-section { padding: 20px 0; }
    
    .main-container { padding: 0 15px; }
    .tags-row { flex-wrap: wrap; overflow: visible; }
    .tags-row .filter-pill { visibility: visible !important; white-space: normal; }
    .gallery { column-count: 2; column-gap: 12px; }
    
    .modal-content { flex-direction: column; height: auto; max-height: 90vh; }
    .modal-images { padding: 15px; }
    .modal-img-container { max-height: 300px; }
    .modal-right { padding: 20px; min-width: auto; max-width: 100%; }
    
    .login-box { width: 100%; max-width: 360px; padding: 30px; }
}

@media (max-width: 480px) {
    .gallery { column-count: 2; }
    textarea { height: 250px; }
}