:root {
    --bg-base: #09090b;
    --bg-surface: #121215;
    --bg-surface-hover: #18181b;
    --border: #27272a;
    --border-focus: #6366f1;
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --text-primary: #f4f4f5;
    --text-muted: #a1a1aa;
    --radius-lg: 16px;
    --radius-md: 10px;
    --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Фикс светлого фона автозаполнения браузера под темную тему */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px #09090b inset !important;
    -webkit-text-fill-color: #f4f4f5 !important;
    caret-color: #f4f4f5 !important;
    transition: background-color 5000s ease-in-out 0s;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Навигация */
.navbar {
    background: rgba(18, 18, 21, 0.75);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.logo span {
    color: var(--accent);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.limit-badge {
    background: rgba(99, 102, 241, 0.1);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.25);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

/* Кнопки */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-accent {
    background: var(--text-primary);
    color: #000;
}
.btn-accent:hover { background: #e4e4e7; }

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border);
}
.btn-outline:hover { background: var(--bg-surface-hover); }

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
}
.btn-ghost:hover { color: var(--text-primary); }

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    transition: color 0.2s ease, background 0.2s ease;
}
.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-surface-hover);
}

/* Hero & Uploader */
.hero-section {
    padding: 50px 20px 40px;
    text-align: center;
}

.hero-title {
    font-size: 42px;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 10px;
}

.hero-subtitle {
    color: var(--text-muted);
    font-size: 16px;
    margin-bottom: 36px;
}

.uploader-card {
    background: var(--bg-surface);
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 48px 24px;
    max-width: 720px;
    margin: 0 auto 50px;
    position: relative;
    transition: all 0.2s ease;
}

.uploader-card.dragover {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.05);
    transform: scale(1.01);
}

.file-hidden { display: none; }

.icon-circle {
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    color: var(--accent);
}

.dropzone-text {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 6px;
}

.dropzone-hint {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 24px;
}

kbd {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: inherit;
    font-size: 12px;
}

.uploader-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.url-input-wrap {
    display: flex;
    gap: 8px;
    max-width: 500px;
    margin: 20px auto 0;
}

.input-text {
    width: 100%;
    background: #000;
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    outline: none;
    font-family: inherit;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}
.input-text:focus { border-color: var(--accent); }

.hidden { display: none !important; }

/* Прогресс-бар */
.upload-progress-list {
    margin-top: 24px;
    text-align: left;
}

.progress-item {
    background: #000;
    padding: 12px;
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    border: 1px solid var(--border);
}

.progress-bar {
    height: 6px;
    background: var(--accent);
    border-radius: 3px;
    width: 0%;
    transition: width 0.2s ease;
    margin-top: 8px;
}

/* Табы */
.gallery-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    justify-content: flex-start;
}

.tab-btn {
    background: transparent;
    color: var(--text-muted);
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.tab-btn.active {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}

.footer {
    margin-top: auto;
    border-top: 1px solid var(--border);
    padding: 24px 0;
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
}

/* Сетка галереи */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 60px;
}

.gallery-card {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-surface);
    aspect-ratio: 1 / 1;
    display: block;
    border: 1px solid var(--border);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.gallery-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
}

.gallery-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
    padding: 8px 12px;
    font-size: 12px;
    color: #fff;
    display: flex;
    justify-content: flex-end;
}

/* Страница просмотра изображения (Dark Minimal) */
/* Страница просмотра изображения */
.view-section {
    padding: 30px 16px 60px;
}

.image-viewer-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 920px;
    margin: 0 auto;
}

.image-display-box {
    background: #000;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-in;
}

.image-display-box img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 6px;
    object-fit: contain;
    display: block;
}

.image-meta-bar {
    margin-bottom: 22px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 16px;
}

.image-meta-bar h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 10px;
}

.meta-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.meta-tags span {
    background: #000;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
}

.codes-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.code-field label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.copy-input {
    display: flex;
    gap: 8px;
    align-items: center;
}

.copy-input input {
    flex: 1;
    height: 40px;
    background: #000;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0 12px;
    color: var(--text-primary);
    font-family: monospace;
    font-size: 13px;
    outline: none;
    box-sizing: border-box;
}

.copy-input input:focus {
    border-color: var(--accent);
}

/* Компактная кнопка-иконка копирования */
.btn-copy-icon {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #18181b;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
    transition: all 0.2s ease;
}

.btn-copy-icon:hover {
    background: #27272a;
    color: #ffffff;
    border-color: #3f3f46;
}

.btn-copy-icon svg {
    width: 17px;
    height: 17px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.btn-copy-icon .icon-check {
    display: none;
}

.btn-copy-icon.copied {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--accent);
    color: #818cf8;
}

.btn-copy-icon.copied .icon-copy {
    display: none;
}

.btn-copy-icon.copied .icon-check {
    display: block;
    stroke: #818cf8;
}

/* Модальное окно полного размера (Lightbox) */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(9, 9, 11, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.lightbox-overlay.active {
    display: flex;
}

.lightbox-box {
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-box img {
    max-width: 94vw;
    max-height: 90vh;
    border-radius: 8px;
    object-fit: contain;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.9);
}

.lightbox-close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 34px;
    height: 34px;
    background: #18181b;
    border: 1px solid #3f3f46;
    border-radius: 50%;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
    transition: all 0.15s ease;
    padding: 0;
}

.lightbox-close:hover {
    background: #27272a;
    border-color: #52525b;
    color: #ffffff;
    transform: scale(1.08);
}

.lightbox-close svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2.2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.copy-input input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Кнопка-иконка копирования */
.btn-copy-icon {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #18181b;
    border: 1px solid #27272a;
    border-radius: 8px;
    color: #a1a1aa;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    padding: 0;
}

.btn-copy-icon:hover {
    background: #27272a;
    color: #ffffff;
    border-color: #3f3f46;
}

.btn-copy-icon.copied {
    background: rgba(99, 102, 241, 0.15);
    border-color: #6366f1;
    color: #818cf8;
}

.btn-copy-icon svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
    stroke: currentColor;
    fill: none;
    transition: transform 0.15s ease;
}

.btn-copy-icon .icon-check {
    display: none;
}

.btn-copy-icon.copied .icon-copy {
    display: none;
}

.btn-copy-icon.copied .icon-check {
    display: block;
    stroke: #818cf8;
}

/* Плавающее модальное окно просмотра (Lightbox) */
.image-display-box {
    cursor: zoom-in;
}

.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(9, 9, 11, 0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    padding: 24px;
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-img {
    max-width: 94vw;
    max-height: 92vh;
    border-radius: 8px;
    object-fit: contain;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.lightbox-close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 34px;
    height: 34px;
    background: #18181b;
    border: 1px solid #3f3f46;
    border-radius: 50%;
    color: #a1a1aa;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    z-index: 1010;
}

.lightbox-close:hover {
    background: #27272a;
    color: #ffffff;
    border-color: #52525b;
    transform: scale(1.08);
}

.lightbox-close svg {
    width: 15px;
    height: 15px;
    stroke-width: 2.2;
    stroke: currentColor;
    fill: none;
}

/* Формы авторизации (Dark Minimal) */
.auth-container {
    max-width: 400px;
    margin: 50px auto;
    padding: 0 16px;
}

.auth-card {
    background: #111114;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 30px 24px;
    box-shadow: 0 16px 36px -10px rgba(0, 0, 0, 0.6);
}

.auth-card h2 {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
    color: #ffffff;
}

.auth-sub {
    font-size: 13px;
    color: #71717a;
    margin-bottom: 22px;
    line-height: 1.4;
}

.form-group {
    margin-bottom: 16px;
}

.form-label-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #a1a1aa;
    margin-bottom: 6px;
}

.form-label-row label {
    margin-bottom: 0;
}

.form-link-sub {
    font-size: 12px;
    color: #818cf8;
    text-decoration: none;
    transition: color 0.15s ease;
}

.form-link-sub:hover {
    color: #a5b4fc;
    text-decoration: underline;
}

.btn-block {
    width: 100%;
    height: 40px;
    margin-top: 8px;
    font-size: 14px;
    font-weight: 500;
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 13px;
    margin-bottom: 16px;
}

.auth-footer-text {
    margin-top: 18px;
    text-align: center;
    font-size: 13px;
    color: #71717a;
}

.auth-footer-text a {
    color: #818cf8;
    text-decoration: none;
    font-weight: 500;
}

.auth-footer-text a:hover {
    text-decoration: underline;
}

/* Вертикальный блок капчи */
.captcha-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.captcha-banner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 46px;
    background: #000;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    overflow: hidden;
    user-select: none;
    transition: border-color 0.2s, background 0.2s;
}

.captcha-banner:hover {
    border-color: #3f3f46;
    background: #09090b;
}

.captcha-banner img {
    height: 38px;
    display: block;
}

.captcha-banner .captcha-reload {
    position: absolute;
    right: 10px;
    font-size: 11px;
    color: #71717a;
    pointer-events: none;
}

.captcha-field {
    width: 100%;
    height: 40px;
    font-family: monospace;
    letter-spacing: 5px;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
}

.captcha-field::placeholder {
    font-family: var(--font);
    letter-spacing: normal;
    font-weight: 400;
    font-size: 13px;
    text-transform: none;
    color: #52525b;
}

/* Админка */
.admin-container {
    padding: 40px 20px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.stat-badge {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.admin-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px;
}

.admin-thumb img {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    border-radius: 6px;
}

.admin-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin: 8px 0;
    color: var(--text-muted);
}

.admin-actions {
    display: flex;
    gap: 6px;
}

.btn-xs {
    padding: 4px 8px;
    font-size: 11px;
}

.btn-danger {
    background: #ef4444;
    color: #fff;
}
.btn-danger:hover {
    background: #dc2626;
}

/* Личный кабинет */
.cabinet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 40px 0 24px;
}
.empty-state {
    text-align: center;
    padding: 60px 0;
    color: var(--text-muted);
}

/* Сайдбар и каркас Админки */
.admin-layout {
    display: flex;
    min-height: calc(100vh - 70px);
}
.admin-sidebar {
    width: 250px;
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
}
.admin-sidebar-header h3 {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 16px;
    padding-left: 10px;
}
.admin-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.admin-nav-item {
    color: var(--text-muted);
    text-decoration: none;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}
.admin-nav-item:hover {
    color: var(--text-primary);
    background: var(--bg-surface-hover);
}
.admin-nav-item.active {
    color: #fff;
    background: var(--accent);
}
.sidebar-stat {
    margin-top: auto;
    padding: 14px;
    background: #000;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}
.admin-main {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

/* Таблицы пользователей */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border);
}
.admin-table th, .admin-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.admin-table th {
    background: #000;
    color: var(--text-muted);
    font-weight: 600;
}
.input-select {
    background: #000;
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
}
.role-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}
.role-admin { background: rgba(239,68,68,0.2); color: #f87171; }
.role-moderator { background: rgba(234,179,8,0.2); color: #facc15; }
.role-user { background: rgba(99,102,241,0.2); color: #818cf8; }

/* Кнопка успешной загрузки в списке файлов */
.status-link-success {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #818cf8;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.35);
    padding: 3px 10px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    transition: all 0.2s ease;
}

.status-link-success:hover {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
}

/* Прогресс-бар хранилища пользователя */
.storage-bar-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 24px;
}

.storage-bar-header {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.storage-track {
    width: 100%;
    height: 8px;
    background: #000;
    border-radius: 4px;
    overflow: hidden;
}

.storage-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #38bdf8);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.storage-fill.warning {
    background: #fbbf24;
}

.storage-fill.danger {
    background: #ef4444;
}

/* ==========================================================================
   Глобальное модальное окно просмотра (Lightbox)
   ========================================================================== */
.lightbox-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(9, 9, 11, 0.92) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    z-index: 999999 !important;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.lightbox-overlay.active {
    display: flex !important;
}

.lightbox-container {
    position: relative;
    max-width: 96vw;
    max-height: 96vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-full-img {
    max-width: 94vw;
    max-height: 90vh;
    border-radius: 8px;
    object-fit: contain;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.95);
    display: block;
}

.lightbox-close-btn {
    position: absolute;
    top: -16px;
    right: -16px;
    width: 38px;
    height: 38px;
    background: #18181b;
    border: 1px solid #3f3f46;
    border-radius: 50%;
    color: #a1a1aa;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
    transition: all 0.2s ease;
    padding: 0;
    z-index: 100;
}

.lightbox-close-btn:hover {
    background: #27272a;
    border-color: #52525b;
    color: #ffffff;
    transform: scale(1.08);
}

.lightbox-close-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2.2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.image-display-box {
    cursor: zoom-in;
}
/* Панель управления автора фото */
.owner-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    background: #000;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin-bottom: 22px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 6px;
}

.status-private {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.25);
    color: #fbbf24;
}

.status-public {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.25);
    color: #86efac;
}

.owner-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    height: 32px;
}

.btn-danger-soft {
    border-color: rgba(239, 68, 68, 0.35) !important;
    color: #f87171 !important;
}

.btn-danger-soft:hover {
    background: rgba(239, 68, 68, 0.15) !important;
    border-color: #ef4444 !important;
}

/* Диалоговое окно подтверждения (Confirm Modal) */
.confirm-dialog-overlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(9, 9, 11, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    animation: fadeInModal 0.15s ease-out;
}

@keyframes fadeInModal {
    from { opacity: 0; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1); }
}

.confirm-dialog-box {
    background: #121214;
    border: 1px solid #27272a;
    border-radius: 12px;
    padding: 24px;
    max-width: 440px;
    width: 100%;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.8);
}

.confirm-dialog-title {
    font-size: 16px;
    font-weight: 600;
    color: #f4f4f5;
    margin: 0 0 10px 0;
}

.confirm-dialog-desc {
    font-size: 13px;
    line-height: 1.5;
    color: #a1a1aa;
    margin: 0 0 22px 0;
}

.confirm-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Векторные монохромные иконки в интерфейсе */
.icon-inline {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    display: inline-block;
    vertical-align: -2px;
    margin-right: 5px;
    flex-shrink: 0;
}

/* ==========================================================================
   Полноэкранное модальное окно просмотра со стрелками листания
   ========================================================================== */
.lightbox-overlay {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(9, 9, 11, 0.94) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    z-index: 999999 !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
    box-sizing: border-box !important;
    user-select: none;
}

.lightbox-overlay.active {
    display: flex !important;
}

.lightbox-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-full-img {
    max-width: 88vw;
    max-height: 88vh;
    border-radius: 8px;
    object-fit: contain;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.95);
    display: block;
}

/* Круглый графитовый крестик */
.lightbox-close-btn {
    position: absolute;
    top: -16px;
    right: -16px;
    width: 36px;
    height: 36px;
    background: #18181b;
    border: 1px solid #27272a;
    border-radius: 50%;
    color: #a1a1aa;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
    transition: all 0.2s ease;
    padding: 0;
    z-index: 20;
}

.lightbox-close-btn:hover {
    background: #27272a;
    border-color: #3f3f46;
    color: #ffffff;
    transform: scale(1.08);
}

.lightbox-close-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2.2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Боковые стрелки листания (Предыдущее / Следующее) */
.lightbox-nav-btn {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: #18181b;
    border: 1px solid #27272a;
    border-radius: 50%;
    color: #a1a1aa;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
    transition: all 0.2s ease;
    padding: 0;
    z-index: 10;
}

.lightbox-nav-btn:hover {
    background: #27272a;
    border-color: #3f3f46;
    color: #ffffff;
    transform: translateY(-50%) scale(1.08);
}

.lightbox-nav-btn svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    stroke-width: 2.2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.lightbox-prev {
    left: 24px;
}

.lightbox-next {
    right: 24px;
}

.lightbox-nav-btn.nav-hidden {
    display: none !important;
}

@media (max-width: 768px) {
    .lightbox-prev { left: 10px; }
    .lightbox-next { right: 10px; }
    .lightbox-close-btn { top: 8px; right: 8px; }
}

/* ==========================================================================
   Уровень 1: Модальная карточка поверх галереи (Quick View)
   ========================================================================== */
.card-quick-overlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(9, 9, 11, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
}

.card-quick-container {
    position: relative;
    max-width: 900px;
    width: 100%;
    margin: auto;
    animation: modalScaleUp 0.18s ease-out;
}

@keyframes modalScaleUp {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

.card-quick-close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 36px;
    height: 36px;
    background: #18181b;
    border: 1px solid #27272a;
    border-radius: 50%;
    color: #a1a1aa;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
    transition: all 0.2s ease;
    z-index: 30;
}

.card-quick-close:hover {
    background: #27272a;
    border-color: #3f3f46;
    color: #ffffff;
    transform: scale(1.08);
}

.card-quick-close svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2.2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Стрелки листания карточек по бокам */
.card-nav-btn {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    height: 46px;
    background: #18181b;
    border: 1px solid #27272a;
    border-radius: 50%;
    color: #a1a1aa;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6);
    transition: all 0.2s ease;
    z-index: 25;
}

.card-nav-btn:hover {
    background: #27272a;
    border-color: #3f3f46;
    color: #ffffff;
    transform: translateY(-50%) scale(1.08);
}

.card-nav-btn svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    stroke-width: 2.2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.card-prev { left: 24px; }
.card-next { right: 24px; }

/* Бейдж подсказки "Увеличить" на картинке */
.image-display-box {
    position: relative;
    cursor: zoom-in;
}

.zoom-hint-badge {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(18, 18, 20, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 11px;
    color: #e4e4e7;
    backdrop-filter: blur(8px);
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: opacity 0.2s;
}

.image-display-box:hover .zoom-hint-badge {
    background: rgba(24, 24, 27, 0.95);
    border-color: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   Уровень 2: Полноэкранный просмотрщик с зумом (колесико мыши)
   ========================================================================== */
.zoom-viewer-overlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 5, 7, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 200000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    user-select: none;
}

.zoom-top-bar {
    position: absolute;
    top: 16px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 50;
}

.zoom-level-badge {
    background: #18181b;
    border: 1px solid #27272a;
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #a1a1aa;
}

.zoom-top-btn {
    width: 36px;
    height: 36px;
    background: #18181b;
    border: 1px solid #27272a;
    border-radius: 50%;
    color: #a1a1aa;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 11px;
    font-weight: 600;
}

.zoom-top-btn:hover {
    background: #27272a;
    border-color: #3f3f46;
    color: #ffffff;
    transform: scale(1.08);
}

.zoom-top-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2.2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.zoom-stage {
    flex: 1;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    overflow: hidden;
}

.zoom-stage.grabbing {
    cursor: grabbing;
}

.zoom-full-img {
    max-width: 90vw;
    max-height: 88vh;
    object-fit: contain;
    transition: transform 0.08s ease-out;
    transform-origin: center center;
    will-change: transform;
    pointer-events: none;
}

.zoom-tip {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(24, 24, 27, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 12px;
    color: #71717a;
    pointer-events: none;
    backdrop-filter: blur(6px);
}

/* ==========================================================================
   Мобильная адаптация для смартфонов (Touch UX)
   ========================================================================== */
@media (max-width: 768px) {
    .card-quick-overlay {
        padding: 12px 8px !important;
        align-items: flex-start !important;
        -webkit-overflow-scrolling: touch;
    }

    .card-quick-container {
        max-width: 100% !important;
        margin: 16px auto !important;
    }

    /* На смартфонах листание только свайпами — стрелки не загромождают экран */
    .card-nav-btn {
        display: none !important;
    }

    .card-quick-close {
        top: 6px !important;
        right: 6px !important;
        width: 38px !important;
        height: 38px !important;
        background: rgba(24, 24, 27, 0.92) !important;
    }

    .owner-toolbar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
        padding: 12px !important;
    }

    .owner-actions {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .owner-actions form,
    .owner-actions button {
        width: 100% !important;
        justify-content: center !important;
        height: 40px !important;
        font-size: 13px !important;
    }

    .codes-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .copy-input input {
        font-size: 13px !important;
        height: 42px !important;
    }

    .btn-copy-icon {
        width: 42px !important;
        height: 42px !important;
    }

    .zoom-top-bar {
        top: 12px !important;
        right: 12px !important;
    }

    .zoom-top-btn {
        width: 40px !important;
        height: 40px !important;
    }

    .zoom-tip {
        display: none !important;
    }
}

/* ==========================================================================
   Премиум-дизайн мобильной версии для смартфонов
   ========================================================================== */
.mobile-action-bar {
    display: none;
}

.file-hidden {
    display: none !important;
}

@media (max-width: 768px) {
    /* Компактная аккуратная шапка сайта */
    .header .container,
    .navbar .container {
        padding: 8px 12px !important;
    }

    .nav-links, .header-nav {
        gap: 6px !important;
    }

    .nav-links a, .header-nav a {
        font-size: 12px !important;
        padding: 4px 6px !important;
    }

    .nav-links .btn, .header-nav .btn {
        padding: 4px 10px !important;
        font-size: 11px !important;
        height: 28px !important;
    }

    /* Лаконичный первый экран */
    .hero-section {
        padding-top: 16px !important;
        padding-bottom: 20px !important;
    }

    .hero-header {
        margin-bottom: 16px !important;
        text-align: center !important;
    }

    .hero-title {
        font-size: 22px !important;
        font-weight: 700 !important;
        letter-spacing: -0.02em !important;
        margin: 0 !important;
    }

    /* Прячем ПК-тексты */
    .hero-subtitle,
    .desktop-only-zone {
        display: none !important;
    }

    /* Гладкая карточка загрузчика */
    .uploader-card {
        background: linear-gradient(180deg, #161619 0%, #101012 100%) !important;
        border: 1px solid #27272a !important;
        border-radius: 20px !important;
        padding: 16px !important;
        box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.7) !important;
    }

    .dropzone-body {
        padding: 0 !important;
    }

    /* 3 аккуратные мобильные кнопки под большой палец */
    .mobile-action-bar {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 10px !important;
        width: 100% !important;
    }

    .mobile-action-btn {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 8px !important;
        height: 76px !important;
        background: #1c1c20 !important;
        border: 1px solid #2e2e33 !important;
        border-radius: 14px !important;
        color: #f4f4f5 !important;
        cursor: pointer !important;
        padding: 8px 4px !important;
        transition: transform 0.12s ease, background 0.12s ease !important;
        -webkit-tap-highlight-color: transparent !important;
    }

    .mobile-action-btn:active {
        transform: scale(0.95) !important;
        background: #27272a !important;
        border-color: #3f3f46 !important;
    }

    /* Центральная кнопка камеры с акцентом */
    .mobile-action-btn.mobile-action-camera {
        background: linear-gradient(180deg, #24242c 0%, #1a1a22 100%) !important;
        border-color: rgba(99, 102, 241, 0.4) !important;
        box-shadow: 0 4px 16px rgba(99, 102, 241, 0.15) !important;
    }

    .mobile-action-btn.mobile-action-camera svg {
        stroke: #818cf8 !important;
    }

    .mobile-btn-icon svg {
        width: 24px !important;
        height: 24px !important;
        stroke: #a1a1aa;
        stroke-width: 2;
        fill: none;
        stroke-linecap: round;
        stroke-linejoin: round;
        display: block;
    }

    .mobile-btn-label {
        font-size: 12px !important;
        font-weight: 600 !important;
        letter-spacing: -0.01em !important;
        color: #e4e4e7 !important;
    }

    /* Чип приватности */
    .privacy-toggle-wrapper {
        margin-top: 14px;
        display: flex;
        justify-content: center;
    }

    .privacy-chip {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        background: #18181b;
        border: 1px solid #27272a;
        padding: 6px 14px;
        border-radius: 20px;
        font-size: 12px;
        color: #a1a1aa;
        cursor: pointer;
    }

    .privacy-chip input {
        accent-color: var(--accent);
        width: 15px;
        height: 15px;
    }

    /* Поле ввода URL на смартфонах */
    .url-input-box {
        margin-top: 14px;
        padding-top: 14px;
        border-top: 1px solid #27272a;
    }

    .url-input-inner {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .url-input-inner input {
        height: 42px !important;
        font-size: 13px !important;
    }

    .url-input-inner button {
        height: 38px !important;
        width: 100% !important;
        justify-content: center;
    }

    /* Капча для гостей */
    .guest-captcha-wrapper {
        margin-top: 16px !important;
        width: 100% !important;
    }

    .captcha-stack {
        display: flex;
        gap: 8px;
        justify-content: center;
    }
}

/* Скрываем громоздкий гостевой счетчик из мобильной шапки */
@media (max-width: 768px) {
    .guest-limit-badge,
    .guest-badge,
    .nav-guest-counter,
    [class*="guest"][class*="badge"] {
        display: none !important;
    }
}

/* Блок капчи: крупный, контрастный и адаптивный */
.captcha-stack {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.captcha-banner {
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #2e2e33;
    display: inline-flex;
    background: #141416;
}

.captcha-banner img {
    height: 44px;
    width: auto;
    display: block;
}

.captcha-reload {
    position: absolute;
    top: 3px;
    right: 5px;
    font-size: 14px;
    color: #a1a1aa;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.captcha-field {
    height: 44px !important;
    text-align: center;
    font-size: 16px !important;
    letter-spacing: 2px;
    font-weight: 600;
    max-width: 140px;
}

/* Скрытие перекошенного бейджа на смартфонах */
@media (max-width: 768px) {
    #guestBadge,
    .limit-badge {
        display: none !important;
    }

    .captcha-stack {
        flex-direction: column;
        width: 100%;
    }

    .captcha-field {
        max-width: 100%;
        width: 100%;
    }

    .captcha-banner {
        width: 100%;
        justify-content: center;
    }

    .captcha-banner img {
        width: 100%;
        max-width: 220px;
        height: 50px;
        object-fit: contain;
    }
}

/* Аккуратный отступ и ряд для антибот-проверки */
.guest-captcha-wrapper {
    margin-top: 24px !important;
    display: flex;
    justify-content: center;
    width: 100%;
}

.captcha-stack {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    flex-direction: row !important;
}

.captcha-banner {
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #27272a;
    display: inline-flex;
    background: #141416;
    height: 40px;
    flex-shrink: 0;
}

.captcha-banner img {
    height: 40px !important;
    width: 140px !important;
    display: block;
}

.captcha-reload {
    position: absolute;
    top: 2px;
    right: 5px;
    font-size: 13px;
    color: #a1a1aa;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.captcha-field {
    height: 40px !important;
    width: 130px !important;
    text-align: center;
    font-size: 14px !important;
    letter-spacing: 2px;
    font-weight: 600;
    text-transform: uppercase;
}

/* Мобильная адаптация галереи и капчи */
@media (max-width: 768px) {
    .guest-captcha-wrapper {
        margin-top: 18px !important;
    }

    .captcha-stack {
        display: flex !important;
        flex-direction: row !important;
        justify-content: center !important;
        width: 100% !important;
        gap: 8px !important;
    }

    .captcha-banner img {
        width: 130px !important;
        height: 40px !important;
    }

    .captcha-field {
        width: 115px !important;
        height: 40px !important;
        font-size: 13px !important;
    }

    /* Галерея на мобильном: заголовок на всю ширину, табы под ним */
    .gallery-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
    }

    .gallery-tabs {
        width: 100% !important;
        display: flex !important;
        gap: 8px !important;
    }

    .gallery-tabs .tab-btn {
        flex: 1 !important;
        text-align: center !important;
        height: 36px !important;
    }
}

/* Точные правила для баннера капчи: никакого сдавливания и обрезки */
.captcha-banner {
    height: 42px !important;
    display: inline-flex !important;
    align-items: center;
    border: 1px solid #27272a !important;
    border-radius: 8px !important;
    background: #141416 !important;
    overflow: hidden;
    flex-shrink: 0;
}

.captcha-banner img {
    height: 42px !important;
    width: auto !important;
    display: block !important;
}

.captcha-field {
    height: 42px !important;
    width: 130px !important;
    text-align: center;
    font-size: 15px !important;
    font-weight: 600;
    letter-spacing: 2px;
}

@media (max-width: 768px) {
    .captcha-banner img {
        height: 40px !important;
        width: auto !important;
    }
    .captcha-field {
        height: 40px !important;
        width: 120px !important;
    }
}

/* Устранение вылезания капчи на смартфонах */
.guest-captcha-wrapper {
    margin-top: 20px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.captcha-stack {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    width: 100% !important;
    max-width: 290px !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
}

.captcha-banner {
    flex: 0 0 auto !important;
    width: 150px !important;
    height: 42px !important;
    border: 1px solid #27272a !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    position: relative !important;
    background: #121216 !important;
}

.captcha-banner img {
    width: 150px !important;
    height: 42px !important;
    display: block !important;
}

.captcha-field {
    flex: 1 1 auto !important;
    min-width: 90px !important;
    max-width: 130px !important;
    height: 42px !important;
    font-size: 14px !important;
    padding: 0 8px !important;
    box-sizing: border-box !important;
    text-align: center !important;
}

@media (max-width: 768px) {
    .uploader-card {
        overflow: hidden !important;
    }

    .captcha-stack {
        max-width: 100% !important;
        gap: 6px !important;
    }

    .captcha-banner {
        width: 135px !important;
        height: 40px !important;
    }

    .captcha-banner img {
        width: 135px !important;
        height: 40px !important;
    }

    .captcha-field {
        height: 40px !important;
        min-width: 80px !important;
        font-size: 13px !important;
    }
}

/* ==========================================================================
   Компактная плиточная галерея (Instagram / Фотопоток)
   ========================================================================== */
.gallery-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
    gap: 12px !important;
}

.gallery-card {
    position: relative !important;
    aspect-ratio: 1 / 1 !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    background: #141417 !important;
    border: 1px solid #242428 !important;
    display: block !important;
    transition: transform 0.15s ease, border-color 0.15s ease !important;
}

.gallery-card:hover {
    transform: translateY(-2px);
    border-color: #3f3f46 !important;
}

.gallery-card img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
}

.gallery-overlay {
    position: absolute !important;
    inset: auto 6px 6px auto !important;
    background: rgba(9, 9, 11, 0.75) !important;
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    font-size: 10px !important;
    color: #d4d4d8 !important;
    pointer-events: none !important;
}

/* Мобильные экраны: 3 или 4 компактные плитки в ряд */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 6px !important;
    }

    .gallery-card {
        border-radius: 6px !important;
    }

    .gallery-overlay {
        display: none !important; /* На микро-плитках скрываем лишние надписи */
    }
}

@media (max-width: 420px) {
    /* На узких смартфонах 3 плитки дают идеальный размер пальца и чёткость */
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 6px !important;
    }
}
