/* «Мои песни»: порядок и вид — плитки или таблица (shelf.js) */
.shelf-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 16px; margin: 8px 0 16px; }
.shelf-bar .section-title { margin: 0; }
.shelf-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.shelf-seg button[data-shelf-view] { display: inline-flex; align-items: center; padding: 0 9px; }

/* ---------- таблица ---------- */
.shelf-table {
  container-type: inline-size;
  --cols: minmax(0, 1fr) 140px 150px 56px 124px 48px 32px;
}
.shelf-row {
  position: relative; display: grid; grid-template-columns: var(--cols); gap: 16px; align-items: center;
  min-height: 60px; padding: 8px 10px 8px 8px; border-radius: 12px;
  color: var(--muted); font-size: 14px; transition: background-color .15s ease;
}
.shelf-row:not(.shelf-head):hover { background: var(--glass); }
.shelf-head {
  min-height: 36px; padding-block: 0; margin-bottom: 4px; border-radius: 0;
  border-bottom: 1px solid var(--border); color: var(--faint); font-size: 12px;
}
.shelf-head [role=columnheader] { display: flex; align-items: center; min-width: 0; white-space: nowrap; }
.shelf-head .shelf-num { justify-content: flex-end; }
.shelf-th {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 0; border: 0; background: none;
  color: inherit; font: inherit; cursor: pointer; transition: color .15s ease;
}
.shelf-th:hover, .shelf-th.on { color: var(--text); }

.shelf-name { display: flex; align-items: center; gap: 12px; min-width: 0; }
.shelf-name .cover { flex: none; width: 44px; border-radius: 8px; }
.shelf-open { display: flex; flex-direction: column; min-width: 0; color: var(--text); text-decoration: none; }
/* вся строка — ссылка на песню, кнопка «убрать» лежит поверх */
.shelf-open::after { content: ""; position: absolute; inset: 0; border-radius: 12px; }
.shelf-open:focus-visible { outline: none; }
.shelf-open:focus-visible::after { outline: 2px solid var(--text); outline-offset: -2px; }
.shelf-open .t, .shelf-open .a { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shelf-open .t { font-size: 15px; font-weight: 500; }
.shelf-open .a { font-size: 13px; color: var(--muted); }
.shelf-row:hover .shelf-open .t { text-decoration: underline; text-underline-offset: 3px; }

.shelf-row > [role=cell] { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shelf-row > .shelf-name, .shelf-row > [role=cell]:last-child { overflow: visible; }
.shelf-num { text-align: right; font-variant-numeric: tabular-nums; }
.shelf-date { font-variant-numeric: tabular-nums; }
.shelf-table .shelf-lines { justify-content: center; text-align: center; } /* справа от числа сразу дата: так они не слипаются */
.shelf-tone { color: var(--note); }
.shelf-shift { margin-left: 4px; padding: 1px 6px; border-radius: 99px; background: var(--glass-2); color: var(--text); font-size: 12px; font-variant-numeric: tabular-nums; }
.shelf-err { color: var(--err); }

.shelf-del { position: relative; z-index: 1; background: transparent; color: var(--muted); opacity: 0; transition: opacity .15s ease, background-color .15s ease, color .15s ease; }
.shelf-row:hover .shelf-del, .shelf-del:focus-visible { opacity: 1; }
.shelf-del:hover { background: var(--miss); color: var(--ink); }
@media (hover: none) { .shelf-del { opacity: 1; } }

/* узкая таблица: сначала уходит диапазон, потом строки, тональность и дата */
@container (max-width: 860px) {
  .shelf-row { --cols: minmax(0, 1fr) 140px 56px 124px 48px 32px; }
  .shelf-table .shelf-range { display: none; }
}
@container (max-width: 700px) {
  .shelf-row { --cols: minmax(0, 1fr) 120px 116px 44px 32px; gap: 14px; }
  .shelf-table .shelf-lines { display: none; }
}
@container (max-width: 540px) {
  .shelf-row { --cols: minmax(0, 1fr) 104px 44px 32px; gap: 12px; }
  .shelf-table .shelf-key { display: none; }
}
@container (max-width: 420px) {
  .shelf-row { --cols: minmax(0, 1fr) 44px 32px; padding-left: 4px; }
  .shelf-table .shelf-date { display: none; }
}
