/* ============================================
   Without Depth — публичная часть (таблица)
   ============================================ */

.page-index {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* === ШАПКА === */

.site-header {
    background: rgba(26, 26, 26, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 1em 1.5em;
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1em;
}

.site-logo {
    font-family: var(--font-heading);
    font-size: 1.2em;
    color: var(--text);
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 0.6em;
    white-space: nowrap;
}

.site-logo img {
    max-height: 40px;
    width: auto;
}

.site-logo:hover {
    color: var(--accent);
}

.site-nav {
    display: flex;
    gap: 1em;
    align-items: center;
}

.site-nav a {
    color: var(--text-dim);
    font-size: 0.9em;
    transition: color var(--transition);
}

.site-nav a:hover {
    color: var(--accent);
}

/* === ОСНОВНОЙ КОНТЕНТ === */

.site-main {
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 2em 1.5em 4em;
}

/* === HERO === */

.home-hero {
    text-align: center;
    margin-bottom: 2.5em;
    padding-top: 1em;
}

.home-title {
    font-size: 2.5em;
    letter-spacing: 0.05em;
    margin-bottom: 0.4em;
    color: var(--text);
}

.home-description {
    font-size: 1em;
    color: var(--text-dim);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.7;
}

/* === ФИЛЬТРЫ === */

.filters {
    margin-bottom: 1.5em;
}

.filter-form {
    display: flex;
    flex-direction: column;
    gap: 1em;
}

.filter-types {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
}

.filter-btn {
    padding: 0.6em 1em;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-dim);
    font-size: 0.9em;
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    transition: all var(--transition);
    white-space: nowrap;
}

.filter-btn:hover {
    border-color: var(--accent-dim);
    color: var(--text);
}

.filter-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #1a1a1a;
    font-weight: 600;
}

.filter-btn .count {
    background: rgba(0, 0, 0, 0.2);
    padding: 0.15em 0.5em;
    border-radius: 10px;
    font-size: 0.8em;
}

.filter-btn.active .count {
    background: rgba(0, 0, 0, 0.25);
}

.filter-search {
    display: flex;
    gap: 0.5em;
}

.filter-search input[type="search"] {
    flex: 1;
    margin-top: 0;
}

.filter-search .btn {
    padding: 0.75em 1.25em;
    white-space: nowrap;
}

/* === ТАБЛИЦА КОНТЕНТА === */

.content-table-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow-x: auto;
}

.content-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
    min-width: 900px;
}

.content-table th {
    text-align: left;
    padding: 1em 0.75em;
    background: var(--bg-deep);
    color: var(--text-dim);
    font-weight: 500;
    border-bottom: 1px solid var(--border);
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.content-table td {
    padding: 1em 0.75em;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: top;
}

.content-table tr:last-child td {
    border-bottom: none;
}

.content-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.item-desc {
    color: var(--text-dim);
    font-size: 0.85em;
    margin-top: 0.4em;
    line-height: 1.5;
}

.item-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3em;
    margin-top: 0.5em;
}

.tag {
    background: var(--bg-deep);
    color: var(--text-mute);
    padding: 0.2em 0.6em;
    border-radius: 10px;
    font-size: 0.75em;
    border: 1px solid var(--border);
}

/* === СОДЕРЖИМОЕ В ТАБЛИЦЕ === */

.content-table audio {
    width: 100%;
    height: 36px;
    filter: invert(0.9) hue-rotate(180deg);
}

.download-link {
    display: inline-block;
    margin-top: 0.5em;
    font-size: 0.85em;
    color: var(--text-dim);
}

.download-link:hover {
    color: var(--accent);
}

.photo-thumb {
    max-width: 100px;
    max-height: 100px;
    width: auto;
    height: auto;
    border-radius: var(--radius-sm);
    cursor: zoom-in;
    transition: all 0.3s ease;
    object-fit: cover;
}

.photo-thumb.expanded {
    max-width: 100%;
    max-height: 400px;
    cursor: zoom-out;
}

.text-content {
    color: var(--text-dim);
    font-size: 0.9em;
    line-height: 1.6;
    font-style: italic;
    max-width: 500px;
}

.date-cell {
    color: var(--text-mute);
    font-size: 0.85em;
    white-space: nowrap;
}

.actions-cell {
    white-space: nowrap;
}

.icon-btn {
    display: inline-block;
    padding: 0.4em;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    font-size: 1em;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.icon-btn:hover {
    background: var(--bg-hover);
    color: var(--text);
    border-color: var(--accent-dim);
}

/* === ПУСТОЕ СОСТОЯНИЕ === */

.empty-state {
    text-align: center;
    padding: 4em 2em;
    color: var(--text-dim);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.empty-state .hint {
    margin-top: 1em;
    font-size: 0.9em;
    color: var(--text-mute);
}

/* === ПОДВАЛ === */

.site-footer {
    padding: 2em 1.5em;
    text-align: center;
    color: var(--text-mute);
    font-size: 0.85em;
    border-top: 1px solid var(--border);
}

/* Фиксы для фильтров и поиска */

.filter-btn,
.filter-btn:link,
.filter-btn:visited {
    color: var(--text-dim);
    text-decoration: none;
}

.filter-btn:hover {
    color: var(--text);
}

.filter-btn.active,
.filter-btn.active:link,
.filter-btn.active:visited {
    color: #1a1a1a;
}

/* Поле поиска — принудительно светлый текст на тёмном */
.filter-search input[type="search"],
.filter-search input[type="text"],
input[type="search"],
input[type="text"] {
    background: var(--bg-deep) !important;
    color: var(--text) !important;
    border: 1px solid var(--border);
}

input[type="search"]::placeholder,
input[type="text"]::placeholder {
    color: var(--text-mute);
    opacity: 1;
}

input[type="search"]:focus,
input[type="text"]:focus {
    background: #151515 !important;
    color: var(--text) !important;
    border-color: var(--accent);
    outline: none;
}

/* Автозаполнение браузера (Chrome/Safari) — жёлтый фон побеждаем */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text);
    -webkit-box-shadow: 0 0 0 1000px var(--bg-deep) inset;
    transition: background-color 5000s ease-in-out 0s;
}

/* ============================================
   ХАРДФИКС ПОЛЕЙ ВВОДА (тёмная тема)
   ============================================ */

input,
textarea,
select,
button {
    font-family: inherit;
    font-size: inherit;
}

/* Все текстовые поля и textarea — принудительно */
input[type="text"],
input[type="search"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="url"],
textarea,
select {
    background-color: #111111 !important;
    color: #e8e8e8 !important;
    border: 1px solid #333333 !important;
    caret-color: #e8e8e8 !important;
    -webkit-text-fill-color: #e8e8e8 !important;
    opacity: 1 !important;
}

/* Фокус */
input[type="text"]:focus,
input[type="search"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="url"]:focus,
textarea:focus,
select:focus {
    background-color: #151515 !important;
    color: #e8e8e8 !important;
    border-color: #8b7355 !important;
    outline: none !important;
    -webkit-text-fill-color: #e8e8e8 !important;
}

/* Placeholder */
input::placeholder,
textarea::placeholder {
    color: #6a6a6a !important;
    opacity: 1 !important;
    -webkit-text-fill-color: #6a6a6a !important;
}

/* Автозаполнение — жёлтый/чёрный фон побеждаем */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus {
    -webkit-text-fill-color: #e8e8e8 !important;
    -webkit-box-shadow: 0 0 0 1000px #111111 inset !important;
    box-shadow: 0 0 0 1000px #111111 inset !important;
    transition: background-color 5000s ease-in-out 0s;
    border: 1px solid #333333 !important;
}

/* Select option (раскрывающийся список) */
select option {
    background-color: #1a1a1a !important;
    color: #e8e8e8 !important;
}

/* ============================================
   Сворачивание текстового контента
   ============================================ */

.text-content {
    position: relative;
    cursor: pointer;
    padding: 0 32px 0 0;    /* Больше отступа справа для иконки */
    line-height: 1.6;
}

.text-content.collapsed {
    max-height: 100px;
    overflow: hidden;
}

/* Градиент внизу свёрнутого текста */
.text-content.collapsed::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 32px;            /* Не доходим до иконки */
    height: 30px;
    background: linear-gradient(transparent, var(--bg-card));
    pointer-events: none;
    z-index: 1;
}

/* Иконка "развернуть" — вне текста, справа сверху */
.text-content.collapsed::after {
    content: '▼';
    position: absolute;
    top: 4px;
    right: 0;
    font-size: 0.8em;
    color: var(--accent);
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 2px 5px;
    border-radius: 3px;
    z-index: 2;
    line-height: 1;
    pointer-events: none;
    width: 20px;
    text-align: center;
}

/* Иконка "свернуть" */
.text-content.expanded::after {
    content: '▲';
    position: absolute;
    top: 4px;
    right: 0;
    font-size: 0.8em;
    color: var(--accent);
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 2px 5px;
    border-radius: 3px;
    z-index: 2;
    line-height: 1;
    pointer-events: none;
    width: 20px;
    text-align: center;
}

.text-content {
    position: relative;
    cursor: pointer;
    padding: 0 25px 0 0;   /* Отступ справа для иконки */
}

.text-content.collapsed {
    max-height: 100px;
    overflow: hidden;
}

.text-content.collapsed::after {
    content: '▼';
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 0.85em;
    color: var(--accent);
    background: var(--bg-card);
    padding: 2px 6px;
    border-radius: 3px;
    z-index: 2;
    line-height: 1;
    pointer-events: none;
}

.text-content.expanded::after {
    content: '▲';
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 0.85em;
    color: var(--accent);
    background: var(--bg-card);
    padding: 2px 6px;
    border-radius: 3px;
    z-index: 2;
    line-height: 1;
    pointer-events: none;
}

/* Убираем старую полоску-градиент, если она мешает */
.text-content.collapsed::before {
    content: none;
}

.text-content.expanded {
    max-height: none;
}

.text-content.expanded {
    padding-bottom: 2em;
}

/* === Стили формы === */

.page-form {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.form-title {
    font-size: 2em;
    margin-bottom: 1.5em;
    color: var(--text);
}

.content-form {
    max-width: 700px;
}

.content-form label {
    display: block;
    margin-bottom: 1.25em;
    color: var(--text-dim);
    font-size: 0.95em;
}

.content-form input[type="text"],
.content-form input[type="file"],
.content-form textarea,
.content-form select {
    display: block;
    width: 100%;
    margin-top: 0.4em;
    padding: 0.75em 1em;
    background: #111111 !important;
    color: #e8e8e8 !important;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 1em;
    -webkit-text-fill-color: #e8e8e8 !important;
}

.content-form input:focus,
.content-form textarea:focus,
.content-form select:focus {
    outline: none;
    border-color: var(--accent);
    background: #151515 !important;
}

.content-form .hint {
    display: block;
    margin-top: 0.4em;
    font-size: 0.85em;
    color: var(--text-mute);
}

.content-form input[type="file"] {
    padding: 0.5em;
    cursor: pointer;
}

.content-form input[type="file"]::file-selector-button {
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 0.5em 1em;
    border-radius: var(--radius-sm);
    margin-right: 1em;
    cursor: pointer;
}

/* === ГЛОБАЛЬНЫЙ ФИКС: перенос длинных слов === */

.content-table td,
.content-table th,
.item-desc,
.text-content,
.item-tags,
.tag {
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
}

.text-content {
    white-space: normal;
    max-width: 500px;
    line-height: 1.6;
}

.text-content.expanded {
    max-height: none;
    max-width: 500px;
}

/* ============================================
   ФИНАЛЬНЫЕ ФИКСЫ
   ============================================ */

/* Общая защита от горизонтального скролла */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

/* Контент на ПК — центрируем, ограничиваем ширину */
.site-main {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 2em 1.5em 4em;
    box-sizing: border-box;
}

/* Обёртка таблицы — на ПК обычная, на мобильном — скролл внутри */
.content-table-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

/* Сама таблица — растягивается по ширине обёртки */
.content-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
    table-layout: auto;
}

/* Текст переносится, не тянет таблицу */
.content-table th,
.content-table td {
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    white-space: normal;
    vertical-align: top;
}

/* Ограничения по колонкам */
.content-table th:nth-child(1),
.content-table td:nth-child(1) { width: 50px; }

.content-table th:nth-child(2),
.content-table td:nth-child(2) { width: 100px; }

.content-table th:nth-child(4),
.content-table td:nth-child(4) { width: 300px; }

.content-table th:nth-child(5),
.content-table td:nth-child(5) { width: 90px; }

.content-table th:nth-child(6),
.content-table td:nth-child(6) { width: 90px; }

/* Текстовый контент — ограничен колонкой */
.text-content {
    max-width: 100%;
    overflow: hidden;
    line-height: 1.6;
}

.text-content.collapsed {
    max-height: 100px;
}

/* Фото — не больше 100px в превью */
.photo-thumb {
    max-width: 100px;
    max-height: 100px;
    width: auto;
    height: auto;
    object-fit: cover;
}

.photo-thumb.expanded {
    max-width: 100%;
    max-height: 500px;
}

/* Аудио — вписывается в колонку */
.content-table audio {
    width: 100%;
    max-width: 280px;
    height: 36px;
    filter: invert(0.9) hue-rotate(180deg);
}

/* ============================================
   ЕДИНЫЙ ДИЗАЙН ДЛЯ ВСЕХ УСТРОЙСТВ
   ============================================ */

html, body {
    overflow-x: hidden;
    max-width: 100%;
}

body {
    min-width: 1100px;      /* Минимальная ширина — как на ПК */
    width: 100%;
}

/* Контент — как на ПК */
.site-main {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 2em 1.5em 4em;
    box-sizing: border-box;
}

/* Таблица — как на ПК */
.content-table-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow-x: auto;
    max-width: 100%;
}

.content-table {
    width: 100%;
    min-width: 1000px;        /* Таблица не сжимается */
    border-collapse: collapse;
    font-size: 0.9em;
    table-layout: fixed;
}

.content-table th,
.content-table td {
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    white-space: normal;
    vertical-align: top;
    padding: 1em 0.75em;
}

/* Фиксированные колонки */
.content-table th:nth-child(1),
.content-table td:nth-child(1) { width: 50px; }

.content-table th:nth-child(2),
.content-table td:nth-child(2) { width: 110px; }

.content-table th:nth-child(3),
.content-table td:nth-child(3) { width: auto; }

.content-table th:nth-child(4),
.content-table td:nth-child(4) { width: 320px; }

.content-table th:nth-child(5),
.content-table td:nth-child(5) { width: 100px; }

.content-table th:nth-child(6),
.content-table td:nth-child(6) { width: 100px; }

/* Текст */
.text-content {
    max-width: 100%;
    overflow: hidden;
    line-height: 1.6;
}

.text-content.collapsed {
    max-height: 100px;
}

/* Фото */
.photo-thumb {
    max-width: 100px;
    max-height: 100px;
    width: auto;
    height: auto;
    object-fit: cover;
}

.photo-thumb.expanded {
    max-width: 100%;
    max-height: 500px;
}

/* Аудио */
.content-table audio {
    width: 100%;
    max-width: 280px;
    height: 36px;
    filter: invert(0.9) hue-rotate(180deg);
}

/* ============================================
   Лайтбокс (модальное окно для фото)
   ============================================ */

.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 2em;
    cursor: zoom-out;
    backdrop-filter: blur(4px);
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 95vw;
    max-height: 95vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    cursor: default;
}

.lightbox-close {
    position: absolute;
    top: 1em;
    right: 1.5em;
    font-size: 2em;
    color: #fff;
    cursor: pointer;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
    z-index: 10000;
}

.lightbox-close:hover {
    opacity: 1;
}

/* Курсор на миниатюре */
.photo-thumb {
    cursor: zoom-in;
}

/* Убираем старое разворачивание в таблице (оно больше не нужно) */
.photo-thumb.expanded {
    max-width: 100px;
    max-height: 100px;
    cursor: zoom-in;
}

/* ============================================
   Прогресс-бар загрузки
   ============================================ */

.upload-progress {
    margin-top: 1.5em;
    padding: 1em;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.upload-progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-deep);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.75em;
}

.upload-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), var(--accent-hover));
    transition: width 0.2s ease;
    border-radius: 4px;
}

.upload-progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.85em;
    color: var(--text-dim);
}

#progressText {
    font-weight: 500;
}

#progressSize {
    color: var(--text-mute);
}

/* ============================================
   Альбомы
   ============================================ */

.album-row {
    cursor: pointer;
    background: var(--bg-deep);
}

.album-row td {
    padding: 0.75em 0.75em;
    border-bottom: 1px solid var(--border);
}

.album-header {
    display: flex;
    align-items: center;
    gap: 1em;
}

.album-toggle {
    width: 20px;
    font-size: 0.85em;
    color: var(--accent);
    transition: transform 0.2s ease;
    flex-shrink: 0;
    text-align: center;
}

.album-row.collapsed .album-toggle {
    transform: rotate(-90deg);
}

.album-cover {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid var(--border);
}

.album-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.album-info {
    flex: 1;
    min-width: 0;
}

.album-title {
    font-family: var(--font-heading);
    font-size: 1.1em;
    color: var(--text);
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    gap: 0.6em;
}

.album-count {
    background: var(--bg-card);
    color: var(--text-mute);
    font-size: 0.7em;
    padding: 0.15em 0.6em;
    border-radius: 10px;
    border: 1px solid var(--border);
    font-family: var(--font-body);
}

.album-desc {
    color: var(--text-mute);
    font-size: 0.85em;
    margin-top: 0.2em;
}

.album-content-row td:first-child {
    padding-left: 2em;
}

/* Заголовки фильтров альбомов */
.filter-albums {
    margin-top: 0.5em;
    padding-top: 0.5em;
    border-top: 1px dashed var(--border);
}

/* Отступы для элементов альбома */
.album-2 td:first-child,
.album-3 td:first-child,
.album-4 td:first-child,
.album-5 td:first-child {
    padding-left: 2em;
}

/* Жёсткое ограничение обложек альбомов */
.album-cover,
.album-cover img {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    max-width: 48px !important;
    max-height: 48px !important;
    object-fit: cover !important;
    display: block;
    overflow: hidden;
    flex-shrink: 0;
}

/* Обложка в форме редактирования (там может быть большая) */
.album-cover-preview {
    max-width: 150px !important;
    max-height: 150px !important;
    width: auto !important;
    height: auto !important;
}

/* Курсор на обложке альбома */
.album-cover-img,
.album-cover img {
    cursor: zoom-in;
    transition: transform 0.2s ease;
}

.album-cover-img:hover,
.album-cover img:hover {
    transform: scale(1.05);
}

/* В форме редактирования альбома — обложка тоже кликабельна */
.album-cover-preview {
    cursor: zoom-in;
    transition: transform 0.2s ease;
}

.album-cover-preview:hover {
    transform: scale(1.02);
}

/* ============================================
   Плитка альбомов
   ============================================ */

.albums-tiles {
    margin-bottom: 3em;
}

.albums-tiles-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1em;
    gap: 1em;
}

.albums-tiles-header h2 {
    font-family: var(--font-heading);
    font-size: 1.3em;
    color: var(--text);
    margin: 0;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 1.3em;
    color: var(--text);
    margin: 2em 0 1em;
}

.albums-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1em;
}

.albums-grid-large {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5em;
}

.album-tile {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75em;
    transition: transform 0.2s ease, border-color 0.2s ease;
    text-align: center;
}

.album-tile:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    color: var(--text);
}

.album-tile-cover {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: var(--radius-sm);
    background: var(--bg-deep);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 0.75em;
    border: 1px solid var(--border);
}

.album-tile-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.album-tile-cover-large {
    margin-bottom: 1em;
}

.album-tile-placeholder {
    font-size: 2.5em;
    opacity: 0.5;
}

.album-tile-title {
    font-family: var(--font-heading);
    font-size: 0.95em;
    color: var(--text);
    letter-spacing: 0.02em;
    margin-bottom: 0.2em;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.album-tile-desc {
    color: var(--text-mute);
    font-size: 0.8em;
    margin-bottom: 0.3em;
    word-wrap: break-word;
}

.album-tile-count {
    color: var(--text-mute);
    font-size: 0.75em;
}

/* ============================================
   Страница альбома
   ============================================ */

.album-page-header {
    display: flex;
    gap: 2em;
    align-items: flex-start;
    margin-bottom: 2.5em;
    padding: 1.5em;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.album-page-cover {
    width: 200px;
    height: 200px;
    flex-shrink: 0;
    border-radius: var(--radius);
    background: var(--bg-deep);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    cursor: zoom-in;
}

.album-page-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.2s ease;
}

.album-page-cover:hover img {
    transform: scale(1.05);
}

.album-page-info {
    flex: 1;
    min-width: 0;
}

.album-page-title {
    font-family: var(--font-heading);
    font-size: 2em;
    letter-spacing: 0.04em;
    color: var(--text);
    margin-bottom: 0.5em;
    word-wrap: break-word;
}

.album-page-desc {
    color: var(--text-dim);
    font-size: 1em;
    line-height: 1.6;
    margin-bottom: 1em;
    word-wrap: break-word;
}

.album-page-count {
    color: var(--text-mute);
    font-size: 0.9em;
}

.album-page-count strong {
    color: var(--text);
}

/* Мобильная адаптация */
@media (max-width: 768px) {
    .album-page-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1em;
    }

    .album-page-title {
        font-size: 1.5em;
    }

    .albums-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.75em;
    }

    .albums-grid-large {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 1em;
    }
}

/* ============================================
   ЖЁСТКИЕ ОГРАНИЧЕНИЯ ОБЛОЖЕК НА МОБИЛЬНОМ
   ============================================ */

/* Плитка альбомов */
.album-tile {
    max-width: 100%;
    overflow: hidden;
}

.album-tile-cover {
    width: 100%;
    max-width: 100%;
    aspect-ratio: 1 / 1;
    max-height: 200px;
    overflow: hidden;
}

.album-tile-cover img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    display: block;
}

/* Плитка на странице каталога — та же логика */
.albums-grid-large .album-tile-cover {
    max-height: 240px;
}

/* Страница альбома — большая обложка */
.album-page-cover {
    width: 200px;
    height: 200px;
    max-width: 200px;
    max-height: 200px;
    flex-shrink: 0;
    overflow: hidden;
}

.album-page-cover img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    display: block;
}

/* ============================================
   МОБИЛЬНАЯ АДАПТАЦИЯ
   ============================================ */

@media (max-width: 768px) {
    /* Плитка альбомов — 2 в ряд */
    .albums-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.6em !important;
    }

    .albums-grid-large {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75em !important;
    }

    .album-tile {
        padding: 0.5em;
    }

    .album-tile-cover {
        max-height: 140px;
    }

    .albums-grid-large .album-tile-cover {
        max-height: 160px;
    }

    .album-tile-title {
        font-size: 0.85em;
    }

    .album-tile-count {
        font-size: 0.7em;
    }

    .album-tile-desc {
        display: none; /* На мобильном описание скрываем — экономия места */
    }

    /* Страница альбома — вертикально */
    .album-page-header {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        padding: 1em !important;
    }

    .album-page-cover {
        width: 160px !important;
        height: 160px !important;
        max-width: 160px !important;
        max-height: 160px !important;
    }

    .album-page-title {
        font-size: 1.4em !important;
    }

    .album-page-desc {
        font-size: 0.9em !important;
    }
}

@media (max-width: 480px) {
    .album-page-cover {
        width: 140px !important;
        height: 140px !important;
        max-width: 140px !important;
        max-height: 140px !important;
    }
}

/* Кнопки перемещения */
.actions-cell {
    white-space: nowrap;
}

.actions-cell .icon-btn,
.actions-cell form {
    vertical-align: middle;
}

.actions-cell form {
    display: inline;
    margin: 0;
    padding: 0;
}

.actions-cell .icon-btn {
    display: inline-block;
    padding: 0.35em 0.55em;
    font-size: 0.95em;
    line-height: 1;
    min-width: 28px;
    text-align: center;
    font-weight: 600;
}