:root {
    --text: #1a1a1a;
    --muted: #666;
    --border: #ddd;
    --bg: #fafafa;
    --table-grid: #b8b2a8;
    --table-cell-bg: #fff;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    color: var(--text);
    background: #fff;
    line-height: 1.5;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 1rem;
    min-width: 0;
}

.site-header {
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}

.site-header__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem 1rem;
    padding-top: 0.45rem;
    padding-bottom: 0.4rem;
}

.site-header__secondary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem 1rem;
    padding-top: 0.3rem;
    padding-bottom: 0.4rem;
    border-top: 1px solid var(--border);
}

.logo {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
    text-decoration: none;
}

.logo:hover {
    text-decoration: underline;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.25rem;
}

.site-nav a,
.site-nav__link {
    color: var(--text);
    text-decoration: none;
    font-size: 0.95rem;
}

.site-nav a:hover,
.site-nav__link:hover {
    text-decoration: underline;
}

.site-nav__link.is-active {
    font-weight: 700;
    text-decoration: underline;
}

.site-nav--catalog .site-nav__link {
    font-size: 1rem;
    font-weight: 600;
}

.site-nav--meta .site-nav__link {
    font-size: 0.8rem;
    color: var(--muted);
}

.access-badge {
    font-size: 0.8rem;
    color: var(--muted);
    white-space: nowrap;
}

.changelog-ticker {
    font-size: 0.8rem;
    color: var(--muted);
    text-decoration: none;
    margin-left: auto;
}

.changelog-ticker:hover {
    text-decoration: underline;
}

.main-content {
    padding-top: 1.25rem;
    padding-bottom: 2rem;
    min-height: 50vh;
}

.site-footer {
    margin-top: 2rem;
    border-top: 1px solid var(--border);
    background: var(--bg);
    color: var(--muted);
    font-size: 0.9rem;
}

.site-footer__inner {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem 2rem;
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
}

.site-footer__brand strong {
    color: var(--text);
}

.site-footer__copy {
    margin: 0.35rem 0 0;
}

.site-footer__contact {
    grid-column: 1 / -1;
    margin: 0;
}

.site-footer__contact a {
    color: var(--text);
}

.site-nav--footer {
    justify-content: flex-end;
}

.content-page {
    max-width: 42rem;
    line-height: 1.6;
}

.content-page p {
    margin: 0.75rem 0;
}

.content-meta {
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 2rem;
}

.content-notice {
    padding: 0.75rem 1rem;
    background: #f5f5f5;
    border-left: 3px solid var(--border);
}

.contact-email {
    font-size: 1.1rem;
}

.contact-email a {
    color: var(--text);
}

.changelog-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.changelog-item {
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--border);
}

.changelog-item__title {
    font-size: 1.1rem;
    margin: 0 0 0.25rem;
}

.changelog-item__date {
    display: block;
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 0.75rem;
}

.changelog-item__body p {
    margin: 0.5rem 0;
}

.changelog-item__body h3 {
    font-size: 1rem;
    margin: 0.85rem 0 0.35rem;
}

.changelog-item__body ul {
    margin: 0.25rem 0 0.5rem 1.25rem;
    padding: 0;
}

@media (max-width: 640px) {
    .site-footer__inner {
        grid-template-columns: 1fr;
    }

    .site-nav--footer {
        justify-content: flex-start;
    }
}

.tile-grid {
    list-style: none;
    padding: 0;
    margin: 1.25rem 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.tile-grid--live {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.tile-grid--soon {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.6rem;
    margin-top: 0;
}

.tile {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    min-height: 96px;
    display: flex;
}

.tile--live {
    min-height: 132px;
}

.tile__link {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.15rem 1rem;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
}

.tile--live .tile__title {
    font-size: 1.25rem;
}

.tile__caption {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--muted);
}

.tile__link:hover {
    background: #f3f6fa;
}

.tile--stub {
    min-height: 64px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    color: #999;
    background: #fafafa;
    border-style: dashed;
    border-color: #e0e0e0;
    cursor: default;
}

.tile--stub .tile__title {
    font-size: 0.9rem;
    font-weight: 500;
}

.tile__note {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

@media (max-width: 640px) {
    .tile-grid--live {
        grid-template-columns: 1fr;
    }
}

/* AG Grid (спринт 2.6): контейнер виден только после инициализации */
.catalog-grid {
    margin: 0.75rem 0;
    --ag-border-color: var(--table-grid);
    --ag-header-background-color: var(--bg);
    --ag-odd-row-background-color: var(--table-cell-bg);
    --ag-background-color: var(--table-cell-bg);
    --ag-header-foreground-color: var(--text);
}

.catalog-grid .grid-links a {
    display: block;
    line-height: 1.5;
}

.catalog-grid.catalog-grid--ready {
    width: 100%;
    border: 1px solid var(--table-grid);
}

.catalog-grid .ag-header {
    background: var(--bg);
    border-bottom: 1px solid var(--table-grid);
}

.catalog-grid .ag-header-cell,
.catalog-grid .ag-cell {
    border-right: 1px solid var(--table-grid);
    border-bottom: 1px solid var(--table-grid);
}

.catalog-grid .ag-root-wrapper,
.catalog-grid .ag-row {
    border-color: var(--table-grid);
}

.breadcrumbs {
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 1rem;
}

.breadcrumbs a {
    color: var(--muted);
}

.meta-line {
    font-size: 0.95rem;
    color: var(--muted);
    margin: 0.25rem 0;
}

.table-scroll {
    overflow: auto;
    max-height: calc(100vh - 12rem);
    max-width: 100%;
    min-width: 0;
    width: 100%;
    margin: 1rem 0;
}

/* Основная таблица списка/СКФ: шапка и таблица на одном экране, строки — внутри. */
.table-scroll--viewport {
    max-height: calc(100dvh - 16.5rem);
    margin: 0.5rem 0 1rem;
    border: 1px solid var(--table-grid);
    box-sizing: border-box;
}

.table-scroll--viewport .catalog-table {
    border: 0;
}

body.page-song-list .table-scroll--viewport {
    max-height: calc(100dvh - 16rem);
    margin-bottom: 0;
}

.catalog-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.95rem;
    border: 1px solid var(--table-grid);
}

.catalog-table th,
.catalog-table td {
    border: 1px solid var(--table-grid);
    padding: 0.45rem 0.6rem;
    vertical-align: top;
    text-align: left;
    background-clip: padding-box;
}

.catalog-table td {
    background: var(--table-cell-bg);
}

.catalog-table th {
    background: #f3efe6;
    font-weight: 600;
}

.catalog-table .col-num {
    width: 3rem;
    text-align: center;
}

.catalog-table .col-forum {
    width: 6.5rem;
    text-align: center;
}

.catalog-table .col-date {
    white-space: nowrap;
}

.catalog-table.song-list .col-source {
    white-space: normal;
    min-width: 10rem;
}

.catalog-table.song-list-others .col-performer {
    white-space: normal;
    min-width: 10rem;
}

.catalog-table.song-list-others .col-fonograms {
    white-space: normal;
    min-width: 12rem;
}

.catalog-table .col-text {
    min-width: 10rem;
    font-family: "Courier New", Courier, monospace;
    font-size: 0.9rem;
}

.catalog-table tr.row-differs td {
    background: #fff8e6;
}

/* СКП: отличия от эталона — красный (только строки текста, не комментарий) */
.catalog-table.skp-table tr.skp-row-text td.cell-differs {
    background: #fde0e0 !important;
    color: #9b1c1c !important;
}

.catalog-table.skp-table td.col-reference:not(.cell-differs),
.catalog-table.skp-table th.col-reference {
    background: #f4faf4;
}

.catalog-table.skp-table td.col-comment {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 0.95rem;
    white-space: pre-wrap;
}

.reference-badge {
    display: inline-block;
    margin-top: 0.2rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: #2d6a2d;
    letter-spacing: 0.02em;
}

.catalog-table.skp-table .reference-badge {
    display: block;
}

.catalog-table.skf-table .reference-badge {
    margin-left: 0.45rem;
    margin-top: 0;
    vertical-align: middle;
}

.catalog-table.skp-table .skp-performer {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    font-weight: normal;
    color: var(--muted);
}

.catalog-table.skp-table tr.skp-row-text td {
    min-height: 1.6em;
}

.catalog-table.skp-table tr.skp-row-text td.col-text {
    min-height: 1.6em;
    white-space: nowrap;
    overflow-wrap: normal;
}

.lyric-empty {
    color: var(--muted);
    display: inline-block;
    min-height: 1.35em;
    line-height: 1.35em;
}

body.page-fonogram-detail .main-content.container {
    max-width: calc(960px * 1.24);
}

body.page-fonogram-detail:has(#skf-edit-bar) .table-scroll--viewport {
    max-height: calc(100dvh - 19.2rem);
}

.catalog-table.skf-detail {
    table-layout: fixed;
}

.catalog-table.skf-table .col-first-line {
    width: 32.26%;
    min-width: 6.5rem;
}

.catalog-table.skf-table .col-performer {
    width: 12.9%;
    min-width: 8rem;
}

.catalog-table.skf-table .col-comment {
    width: 38.71%;
    min-width: 24rem;
}

.catalog-table.skf-table .skf-header-row th {
    font-weight: 600;
    white-space: normal;
    line-height: 1.25;
}

.catalog-table.skf-table .skf-song-link {
    font-weight: 600;
}

.catalog-table.skf-table .skf-empty {
    text-align: center;
    color: var(--muted);
}

.skp-reference-note {
    font-size: 0.9rem;
    color: var(--muted);
    margin: 0 0 0.2rem;
}

.catalog-table.skp-table-transposed {
    --skp-rownum-width: 2.15rem;
    table-layout: fixed;
    width: max-content;
    min-width: 0;
}

.catalog-table.skp-table-transposed .col-fonogram {
    width: var(--skp-col-width);
    min-width: var(--skp-col-width);
    max-width: var(--skp-col-width);
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
}

.catalog-table thead {
    position: sticky;
    top: 0;
    z-index: 5;
}

.catalog-table thead th,
.catalog-table thead td {
    background: #f3efe6;
}

.catalog-table.skf-table .skf-header-row th {
    position: sticky;
    top: 0;
    z-index: 6;
    background: #f3efe6;
}

body.page-song-detail .main-content.container {
    max-width: none;
    padding-top: 0.55rem;
    padding-bottom: 1rem;
    padding-left: 80px;
    padding-right: 80px;
}

body.page-song-detail .breadcrumbs {
    margin-bottom: 0.2rem;
}

body.page-song-detail .skp-edit-bar {
    margin: 0 0 0.25rem;
}

.skp-shell {
    --skp-rownum-width: 2.15rem;
    --skp-col-width: 12rem;
    display: block;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    height: calc(100dvh - 14.7rem);
    max-height: calc(100dvh - 14.7rem);
    margin: 0.3rem 0 0;
    border: 1px solid var(--table-grid);
    overflow-x: auto;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.skp-shell .catalog-table {
    margin: 0;
    border: 0;
}

.skp-shell .catalog-table.skp-table-transposed {
    width: max-content;
    min-width: 0;
}

.skp-shell thead th {
    position: sticky;
    top: 0;
    z-index: 4;
}

.skp-shell .skp-sticky-rownum {
    position: sticky;
    left: 0;
    z-index: 3;
}

.skp-shell .skp-sticky-first {
    position: sticky;
    left: var(--skp-rownum-width);
    z-index: 2;
    box-shadow: 4px 0 8px rgba(0, 0, 0, 0.12);
}

.skp-shell thead th.skp-sticky-rownum {
    z-index: 6;
    top: 0;
    left: 0;
}

.skp-shell thead th.skp-sticky-first {
    z-index: 5;
    top: 0;
    left: var(--skp-rownum-width);
}

.catalog-table.skp-table-transposed .col-rownum {
    width: var(--skp-rownum-width);
    min-width: var(--skp-rownum-width);
    max-width: var(--skp-rownum-width);
    padding-left: 0.2rem;
    padding-right: 0.2rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    background: #f3efe6;
}

.catalog-table.skp-table-transposed .col-frozen,
.catalog-table.skp-table-transposed td.col-text,
.catalog-table.skp-table-transposed td.col-comment {
    width: var(--skp-col-width);
    min-width: var(--skp-col-width);
    max-width: var(--skp-col-width);
}

.catalog-table.skp-table-transposed thead th.col-frozen,
.catalog-table.skp-table-transposed td.col-frozen:not(.cell-differs) {
    background: #f4faf4;
}

.catalog-table.skp-table-transposed td.col-frozen.cell-differs {
    background: #fde0e0;
}

.skf-title {
    font-size: 1.5rem;
    margin: 0 0 0.35rem;
}

.skf-title.song-list-section {
    margin-top: 1.5rem;
}

.skp-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.75rem;
    margin: 0.1rem 0 0.15rem;
    font-size: 1.5rem;
}

.skp-title-text {
    font-size: 1.5rem;
}

.forum-stub {
    color: #999;
    cursor: default;
    font-size: 0.8rem;
    font-style: italic;
}

.forum-link {
    font-size: 0.9rem;
    text-decoration: underline;
}

.forum-inline {
    margin-left: 0.75rem;
    font-size: 1rem;
}

.fonogram-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.fonogram-links li {
    margin: 0.2rem 0;
}

/* --- Учётная запись и навигация --- */
.site-nav--account {
    margin-left: auto;
    display: flex;
    gap: 0.75rem;
}

/* --- Сообщения (messages framework) --- */
.messages {
    list-style: none;
    margin: 0 0 1.25rem;
    padding: 0;
}

.message {
    padding: 0.6rem 0.9rem;
    border: 1px solid var(--border);
    border-left-width: 4px;
    margin-bottom: 0.5rem;
    background: var(--bg);
}

.message--success { border-left-color: #2e7d32; }
.message--error { border-left-color: #c62828; }
.message--info { border-left-color: #1565c0; }
.message--warning { border-left-color: #ef6c00; }

/* --- Формы --- */
.form {
    max-width: 480px;
    margin: 1.25rem 0;
}

.form--inline {
    display: inline-block;
    margin: 0.5rem 0;
}

.form__row {
    margin-bottom: 1rem;
}

.form__row label {
    display: block;
    margin-bottom: 0.3rem;
    color: var(--muted);
}

.form input[type="text"],
.form input[type="email"],
.form input[type="url"],
.form input[type="password"],
.form textarea {
    width: 100%;
    padding: 0.55rem 0.65rem;
    border: 1px solid var(--border);
    font-family: inherit;
    font-size: 1rem;
    background: #fff;
}

.form__row--checkbox .form__check,
.form__check {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    color: var(--text);
}

.form__row--captcha input[type="hidden"] {
    display: none;
}

.form__hint {
    margin: 0.35rem 0 0;
    font-size: 0.875rem;
    color: var(--muted);
}

.form__check input {
    margin-top: 0.25rem;
}

.form__field-error {
    color: #c62828;
    margin: 0.3rem 0 0;
    font-size: 0.9rem;
}

.form__errors {
    color: #c62828;
    margin-bottom: 1rem;
}

/* --- Кнопки --- */
.btn {
    display: inline-block;
    padding: 0.55rem 1.1rem;
    border: 1px solid var(--text);
    background: #fff;
    color: var(--text);
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
}

.btn--primary {
    background: var(--text);
    color: #fff;
}

.btn--danger {
    border-color: #c62828;
    color: #c62828;
}

.btn--small {
    padding: 0.3rem 0.7rem;
    font-size: 0.9rem;
}

/* --- Модерация --- */
.mod-card {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.4rem 1rem;
    margin: 1rem 0 1.5rem;
}

.mod-card dt { color: var(--muted); }
.mod-card dd { margin: 0; }

.mod-actions {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 560px;
}

.mod-reject fieldset {
    border: 1px solid var(--border);
    margin: 0 0 1rem;
}

.mod-reject .form__check {
    margin: 0.4rem 0;
}

.mod-table {
    width: 100%;
}

/* Комментарий к фонограмме и фото — под таблицей СКФ */
.skf-fonogram-comments {
    margin: 0.75rem 0 0.35rem;
}

/* --- Фотографии на странице СКФ --- */
.skf-photo-strip {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 12px;
    margin: 0.75rem 0 1.1rem;
    padding: 8px 0;
    overflow-x: auto;
    width: 100%;
    max-width: 100%;
}
.skf-photo-strip__item {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 96px;
    margin: 0;
}
.skf-photo-strip__thumb {
    box-sizing: border-box;
    width: 80px;
    height: 80px;
    padding: 0;
    margin: 0;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: #eee;
    cursor: pointer;
    overflow: hidden;
}
.skf-photo-strip__thumb img {
    display: block;
    width: 80px;
    height: 80px;
    object-fit: cover;
    -webkit-user-drag: none;
    user-select: none;
    pointer-events: none;
}
.skf-photo-strip[data-skf-protect],
.skf-lightbox[data-skf-protect] {
    -webkit-user-select: none;
    user-select: none;
}
.skf-photo-strip__caption {
    margin: 0.35rem 0 0;
    font-size: 0.78rem;
    line-height: 1.25;
    color: var(--muted);
    text-align: center;
    word-break: break-word;
}
.skf-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.78);
}
.skf-lightbox.is-open {
    display: flex;
}
.skf-lightbox__stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    max-width: 92vw;
    max-height: 92vh;
}
.skf-lightbox__frame {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 80vw;
    max-height: 84vh;
}
.skf-lightbox__canvas {
    display: block;
    max-width: 80vw;
    max-height: 76vh;
    width: auto;
    height: auto;
    background: #111;
    -webkit-user-drag: none;
    user-select: none;
}
.skf-lightbox__caption {
    margin: 0.6rem 0 0;
    max-width: 80vw;
    color: #f2f2f2;
    font-size: 0.95rem;
    line-height: 1.35;
    text-align: center;
}
.skf-lightbox button,
.skf-lightbox__close {
    border: none;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    cursor: pointer;
    font-size: 2rem;
    line-height: 1;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 4px;
}
.skf-lightbox__close {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    font-size: 1.6rem;
}

.skp-edit-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.75rem;
    margin: 0 0 0.75rem;
}

.skp-mode-label--view,
.skp-edit-bar.is-editing .skp-mode-label--edit {
    font-weight: 700;
}

.skp-edit-bar.is-editing .skp-mode-label--view {
    font-weight: 400;
    color: var(--muted);
}

.skp-mode-switch {
    position: relative;
    width: 2.6rem;
    height: 1.4rem;
    padding: 0;
    border: 1px solid var(--table-grid);
    border-radius: 999px;
    background: #fff;
    cursor: pointer;
}

.skp-mode-switch__knob {
    position: absolute;
    top: 0.12rem;
    left: 0.12rem;
    width: 1.05rem;
    height: 1.05rem;
    border-radius: 50%;
    background: #444;
}

.skp-mode-switch[aria-checked="true"] {
    background: #2d6a2d;
    border-color: #2d6a2d;
}

.skp-mode-switch[aria-checked="true"] .skp-mode-switch__knob {
    left: 1.32rem;
    background: #fff;
}

.skp-edit-actions {
    display: inline-flex;
    gap: 0.4rem;
}

.skp-edit-actions[hidden],
.skp-edit-error[hidden] {
    display: none;
}

.skp-edit-save,
.skp-edit-cancel,
.skp-line-add,
.skp-line-del {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 0.85rem;
    cursor: pointer;
    border: 1px solid var(--table-grid);
    background: #fff;
    border-radius: 4px;
}

.skp-edit-save,
.skp-edit-cancel {
    padding: 0.25rem 0.7rem;
}

.skp-edit-save {
    background: #2d6a2d;
    border-color: #2d6a2d;
    color: #fff;
}

.skp-line-add {
    display: block;
    margin: 0.35rem auto 0;
    padding: 0.1rem 0.4rem;
}

.skp-edit-line {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.skp-edit-input {
    width: 100%;
    min-width: 0;
    font-family: "Courier New", Courier, monospace;
    font-size: 0.9rem;
    border: 1px solid var(--table-grid);
    background: #fff;
    padding: 0.15rem 0.3rem;
}

tr.skp-row-text td.cell-differs .skp-edit-input {
    background: #fde0e0;
    color: #9b1c1c;
}

td.col-comment .skp-edit-input {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 0.95rem;
}

.skp-line-del {
    flex: 0 0 auto;
    width: 1.4rem;
    height: 1.4rem;
    line-height: 1;
    padding: 0;
}

body.skp-editing .catalog-table.skp-table tr.skp-row-text td.col-text,
body.skp-editing .catalog-table.skp-table td.col-comment {
    white-space: normal;
}

body.skp-editing .catalog-table.skp-table-transposed .col-fonogram,
body.skp-editing .catalog-table.skp-table-transposed td.col-text,
body.skp-editing .catalog-table.skp-table-transposed td.col-comment {
    width: auto;
    min-width: 16rem;
    max-width: none;
}

body.skf-editing .catalog-table.skf-detail td.col-first-line,
body.skf-editing .catalog-table.skf-detail td.col-performer,
body.skf-editing .catalog-table.skf-detail td.col-comment {
    white-space: normal;
}

body.skf-editing .catalog-table.skf-detail td.col-comment .skp-edit-input {
    min-height: 4.2rem;
    resize: vertical;
}

.skp-edit-error {
    flex-basis: 100%;
    margin: 0;
    color: #9b1c1c;
}

body.page-chessboard .main-content.container {
    max-width: none;
    padding-top: 0.55rem;
    padding-bottom: 1rem;
    padding-left: 80px;
    padding-right: 80px;
}

body.page-chessboard .breadcrumbs {
    margin-bottom: 0.2rem;
}

.chess-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.75rem;
    margin: 0 0 0.25rem;
    font-size: 0.9rem;
    color: var(--muted);
}

#chess-filter-clear {
    font: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--text);
    background: #f3efe6;
    border: 1px solid var(--table-grid);
    padding: 0.1rem 0.55rem;
}

#chess-filter-clear:hover {
    background: #fff176;
}

.chess-shell {
    display: block;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    height: calc(100dvh - 16.2rem);
    max-height: calc(100dvh - 16.2rem);
    margin: 0.3rem 0 0;
    border: 1px solid var(--table-grid);
    overflow: auto;
    overscroll-behavior: contain;
}

.chess-shell .catalog-table {
    margin: 0;
    border: 0;
}

.catalog-table.chess-table {
    table-layout: fixed;
    width: max-content;
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.catalog-table.chess-table .col-song {
    position: sticky;
    left: 0;
    z-index: 3;
    width: 18rem;
    min-width: 18rem;
    max-width: 18rem;
    background: #f3efe6;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
}

.catalog-table.chess-table thead th {
    position: sticky;
    top: 0;
    z-index: 4;
    background: #f3efe6;
    white-space: normal;
    vertical-align: bottom;
    line-height: 1.2;
    font-size: 0.8rem;
    height: 6.2rem;
}

.catalog-table.chess-table .chess-col-filter {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    font: inherit;
    font-weight: 600;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.catalog-table.chess-table .chess-col-filter:hover,
.catalog-table.chess-table .chess-col-filter[aria-pressed="true"] {
    text-decoration: underline;
}

.catalog-table.chess-table .chess-fono-open {
    display: inline-block;
    margin-top: 0.15rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.catalog-table.chess-table th.is-filtered-col,
.catalog-table.chess-table td.is-filtered-col {
    box-shadow: inset 0 0 0 2px #c9a227;
}

.catalog-table.chess-table thead th.is-filtered-col {
    background: #fff176;
}

.catalog-table.chess-table thead th.col-song {
    z-index: 6;
    top: 0;
    left: 0;
    cursor: pointer;
    vertical-align: middle;
    font-size: 0.95rem;
}

.catalog-table.chess-table tbody th.col-song {
    z-index: 3;
    font-weight: 600;
}

.catalog-table.chess-table .col-fono,
.catalog-table.chess-table .col-mark {
    width: 8.5rem;
    min-width: 8.5rem;
    max-width: 8.5rem;
}

.catalog-table.chess-table .col-mark {
    font-size: 0.78rem;
    line-height: 1.2;
    vertical-align: top;
    overflow-wrap: anywhere;
}

.catalog-table.chess-table td.cell-present {
    font-weight: 700;
}

.catalog-table.chess-table td.cell-first {
    background: #fff176;
}
