body {
  font-family: Arial, sans-serif;
  background: #eef1f4;
  color: #202124;
  margin: 0;
}

.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px;
  background: #fff;
  min-height: 100vh;
}

.page-header {
  border-bottom: 1px solid #d8dde3;
  margin-bottom: 24px;
  padding-bottom: 18px;
}

.page-header h1 {
  font-size: 32px;
  line-height: 1.15;
  margin: 0;
}

.layout {
  align-items: start;
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
}

.catalog {
  position: sticky;
  top: 18px;
}

.search {
  display: grid;
  gap: 8px;
  margin-bottom: 22px;
}

.search span {
  color: #58616d;
  font-size: 14px;
}

.search input {
  border: 1px solid #c6ccd3;
  border-radius: 8px;
  box-sizing: border-box;
  font: inherit;
  min-height: 44px;
  padding: 10px 12px;
  width: 100%;
}

.artist-group {
  margin-bottom: 22px;
}

.artist-toggle {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: #202124;
  cursor: pointer;
  display: grid;
  font: inherit;
  gap: 8px;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  margin: 0 0 8px;
  padding: 6px 8px;
  text-align: left;
  width: 100%;
}

.artist-toggle:hover {
  background: #edf4fb;
}

.artist-toggle:focus-visible {
  outline: 2px solid #7aa7d9;
  outline-offset: 2px;
}

.artist-toggle-icon {
  color: #58616d;
  display: inline-block;
  font-size: 16px;
  line-height: 1;
  transform-origin: center;
  transition: transform 140ms ease;
}

.artist-name {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.artist-count {
  background: #eef1f4;
  border-radius: 999px;
  color: #58616d;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  min-width: 1.6em;
  padding: 5px 7px;
  text-align: center;
}

.artist-group.collapsed .artist-toggle-icon {
  transform: rotate(-90deg);
}

.artist-group.collapsed ul {
  display: none;
}

.artist-group ul {
  border-left: 2px solid #d8dde3;
  list-style: none;
  margin: 0;
  padding: 0 0 0 14px;
}

.artist-group li {
  margin: 2px 0;
}

.artist-group a {
  border-radius: 6px;
  color: #28435f;
  display: block;
  padding: 8px 10px;
  text-decoration: none;
}

.artist-group a:hover,
.artist-group a.active {
  background: #edf4fb;
  color: #101820;
}

.song {
  min-width: 0;
}

.song-header {
  align-items: end;
  border-bottom: 1px solid #d8dde3;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 22px;
  padding-bottom: 16px;
}

.song-header p {
  color: #58616d;
  font-size: 15px;
  margin: 0 0 4px;
}

.song-header h2 {
  font-size: 34px;
  line-height: 1.15;
  margin: 0 0 10px;
}

.song-header span {
  color: #58616d;
  font-size: 15px;
}

.auto-scroll-button {
  background: #28435f;
  border: 1px solid #28435f;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  min-height: 42px;
  min-width: 112px;
  padding: 9px 14px;
}

.auto-scroll-button:hover,
.auto-scroll-button.active {
  background: #b3261e;
  border-color: #b3261e;
}

.auto-scroll-button.active {
  bottom: 20px;
  box-shadow: 0 10px 28px rgba(16, 24, 32, 0.18);
  position: fixed;
  right: 20px;
  z-index: 30;
}

.auto-scroll-button:focus-visible {
  outline: 2px solid #7aa7d9;
  outline-offset: 2px;
}

.song-body {
  overflow-x: auto;
}

.song-line {
  align-items: flex-end;
  display: flex;
  flex-wrap: wrap;
  font-size: 20px;
  line-height: 1.35;
  margin: 18px 0;
  white-space: pre-wrap;
}

.chord-word {
  align-items: flex-start;
  display: inline-flex;
  flex-direction: column;
  margin-right: 2px;
  position: relative;
}

.chord {
  color: #b3261e;
  cursor: help;
  display: inline-block;
  font-weight: bold;
  line-height: 1;
  min-height: 1.1em;
  outline: none;
}

.chord:focus-visible {
  outline: 2px solid #7aa7d9;
  outline-offset: 2px;
}

.chord-tooltip {
  background: #fff;
  border: 1px solid #c6ccd3;
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(16, 24, 32, 0.18);
  color: #202124;
  display: none;
  gap: 4px;
  left: 50%;
  min-width: 118px;
  opacity: 0;
  padding: 8px 10px 10px;
  pointer-events: none;
  position: absolute;
  bottom: calc(100% + 8px);
  transform: translateX(-50%) translateY(4px);
  transition: opacity 140ms ease, transform 140ms ease;
  visibility: hidden;
  z-index: 20;
}

.chord-word-start .chord-tooltip {
  left: 0;
  transform: translateY(4px);
}

.song-line-top .chord-tooltip {
  bottom: auto;
  top: calc(100% + 8px);
  transform: translateX(-50%) translateY(-4px);
}

.song-line-top .chord-word-start .chord-tooltip {
  transform: translateY(-4px);
}

.chord-word:hover .chord-tooltip,
.chord-word:focus-within .chord-tooltip {
  display: grid;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  visibility: visible;
}

.chord-word-start:hover .chord-tooltip,
.chord-word-start:focus-within .chord-tooltip {
  transform: translateY(0);
}

.song-line-top .chord-word:hover .chord-tooltip,
.song-line-top .chord-word:focus-within .chord-tooltip {
  transform: translateX(-50%) translateY(0);
}

.song-line-top .chord-word-start:hover .chord-tooltip,
.song-line-top .chord-word-start:focus-within .chord-tooltip {
  transform: translateY(0);
}

.chord-tooltip strong {
  font-size: 16px;
  line-height: 1.1;
  text-align: center;
}

.chord-missing {
  color: #58616d;
  font-size: 13px;
  font-weight: normal;
  line-height: 1.25;
  margin: 0;
  max-width: 136px;
  text-align: center;
}

.chord-diagram {
  display: block;
  height: 92px;
  width: 96px;
}

.diagram-grid line {
  stroke: #88919b;
  stroke-width: 1;
}

.diagram-grid .nut {
  stroke: #5f6b78;
  stroke-width: 3;
}

.diagram-markers circle {
  fill: #5b6fa8;
}

.diagram-markers text,
.fret-label {
  fill: #202124;
  font-size: 13px;
  font-weight: normal;
  text-anchor: middle;
}

.fret-label {
  text-anchor: start;
}

.lyric-text,
.lyric-part {
  white-space: pre-wrap;
}

.empty {
  color: #58616d;
  margin: 0;
}

@media (max-width: 760px) {
  .page {
    padding: 18px;
  }

  .page-header h1 {
    font-size: 26px;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .catalog {
    position: static;
  }

  .song-header h2 {
    font-size: 28px;
  }

  .song-header {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .auto-scroll-button {
    width: 100%;
  }

  .auto-scroll-button.active {
    bottom: 14px;
    left: 18px;
    right: 18px;
    width: auto;
  }

  .song-line {
    font-size: 22px;
  }
}
