.lyrics-block {
  margin: 0;
  padding: 20px;
  border-radius: 18px;
  background: linear-gradient(180deg, #fcfcfd 0%, #f8fafc 100%);
  border: 1px solid rgba(15, 23, 42, 0.06);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  font-family: "Be Vietnam Pro", system-ui, sans-serif;
  font-size: 1.1rem;
  line-height: 2;
  letter-spacing: 0.01em;
  color: #1f2937;
}

.lyrics-block.is-enhanced {
  white-space: normal;
}

.lyrics-render {
  display: block;
}

.lyrics-line {
  display: block;
  margin-bottom: 0.42rem;
}

.lyrics-line.is-empty {
  height: 1.15rem;
  margin-bottom: 0.72rem;
}

.lyrics-inline .lyrics-line {
  line-height: 2;
}

.lyrics-plain .lyrics-line {
  line-height: 1.95;
  color: #1f2937;
}

.chord-badge-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #0f766e;
  font-weight: 700;
  line-height: 1.1;
  margin: 0 0.22em 0.14em 0.22em;
  padding: 0.14em 0.5em;
  border-radius: 10px;
  background: rgba(15, 118, 110, 0.12);
  border: 1px solid rgba(15, 118, 110, 0.2);
  font-size: 0.88em;
  vertical-align: baseline;
}

.inline-lyric-text,
.plain-lyric-text {
  color: #1f2937;
}

.lyrics-inline .lyrics-section,
.lyrics-plain .lyrics-section,
.lyrics-above-section {
  display: inline-flex;
  align-items: center;
  margin-bottom: 0.5rem;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.08);
  border: 1px solid rgba(15, 118, 110, 0.14);
  color: #0f766e;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ========================================
   LEGACY ABOVE MODE
   ======================================== */

.lyrics-above {
  display: block;
}

.lyrics-above-line {
  position: relative;
  display: block;
  margin-bottom: 0.82rem;
}

.lyrics-above-line.is-empty {
  height: 1.2rem;
  margin-bottom: 0.75rem;
}

.lyrics-above-chords {
  position: relative;
  height: 1.05em;
  margin-bottom: 0.08rem;
}

.lyrics-above-lyrics {
  position: relative;
  line-height: 1.85;
  color: #1f2937;
}

.lyrics-above-chord {
  position: absolute;
  top: 0;
  color: #0f766e;
  font-weight: 800;
  font-size: 0.82em;
  line-height: 1;
  white-space: nowrap;
  letter-spacing: 0;
  pointer-events: none;
}

.lyrics-above-lyrics .above-lyric-text {
  color: #1f2937;
}

/* ========================================
   CLUSTER ABOVE MODE
   ======================================== */

.lyrics-above--visual {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.lyrics-above-line--clustered {
  display: block;
  margin-bottom: 0.35rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
}

.lyrics-above-line--section {
  margin: 2px 0 4px;
}

.lyrics-above-leading-text,
.lyrics-above-free-text {
  font-size: 1rem;
  line-height: 1.8;
  color: #6b7280;
  white-space: pre-wrap;
}

.lyrics-above-clusters {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 0;
  white-space: nowrap;
  min-width: max-content;
}

.lyrics-above-clusters--flow {
  align-items: flex-end;
}

.lyrics-above-leading-text {
  margin-bottom: 8px;
}

.lyrics-chord-cluster__lyric--empty {
  display: inline-block;
  min-height: 1.35em;
}

.lyrics-chord-cluster {
  display: inline-flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 6px;
  vertical-align: top;
  white-space: nowrap;
}

.lyrics-chord-cluster__visual {
  display: inline-flex;
  align-items: flex-end;
  justify-content: flex-start;
  min-height: 110px;
  min-width: 88px;
  overflow: visible;
}

.lyrics-above-text-segment {
  display: inline-flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  white-space: nowrap;
}

.lyrics-above-text-segment__top {
  display: block;
  width: 0;
  min-width: 0;
  min-height: 110px;
}

.lyrics-above-text-segment__lyric {
  display: inline-block;
  font-size: 1rem;
  line-height: 1.35;
  color: #111827;
  white-space: pre;
}

.lyrics-chord-cluster__lyric {
  display: inline-block;
  font-size: 1rem;
  line-height: 1.35;
  color: #111827;
  white-space: pre;
}

/* ========================================
   ABOVE MODE - MINI GUITAR SHAPE
   ======================================== */

.cg-above-guitar {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: inherit;
  font: inherit;
}

.cg-above-guitar__name {
  font-size: 13px;
  line-height: 1;
  font-weight: 800;
  color: #374151;
  text-align: center;
  min-height: 14px;
}

.cg-above-guitar__shape {
  display: grid;
  grid-template-columns: 14px auto;
  align-items: start;
  column-gap: 6px;
}

.cg-above-guitar__shape-left {
  position: relative;
  width: 14px;
  height: 52px;
  flex: 0 0 14px;
}

.cg-above-guitar__side-marker {
  position: absolute;
  left: 50%;
  top: calc((6 - var(--cg-string)) * 20%);
  transform: translate(-50%, -50%);
  font-size: 10px;
  line-height: 1;
  font-weight: 700;
  color: #6b7280;
}

.cg-above-guitar__side-marker--empty {
  opacity: 0;
}

.cg-above-guitar__shape-main {
  display: grid;
  grid-template-columns: 8px 68px;
  align-items: stretch;
  column-gap: 6px;
}

.cg-above-guitar__nut {
  width: 6px;
  height: 52px;
  border-radius: 999px;
  background: #111827;
  display: block;
  align-self: stretch;
}

.cg-above-guitar__start-fret {
  width: 8px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  line-height: 1;
  font-weight: 800;
  color: #374151;
  text-align: center;
}

.cg-above-guitar__board {
  position: relative;
  width: 68px;
  height: 52px;
  overflow: visible;
}

.cg-above-guitar__string-line {
  position: absolute;
  left: 0;
  right: 0;
  top: calc((6 - var(--cg-string)) * 20%);
  height: 1.5px;
  background: #6b7280;
  transform: translateY(-50%);
}

.cg-above-guitar__fret-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc((var(--cg-line) - 1) * 20%);
  width: 1.5px;
  background: #9ca3af;
  transform: translateX(-50%);
}

.cg-above-guitar__dot {
  position: absolute;
  left: calc((var(--cg-fret) - 0.5) * 20%);
  top: calc((6 - var(--cg-string)) * 20%);
  width: 13px;
  height: 13px;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.10);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #111827;
  border: 1px solid rgba(17, 24, 39, 0.14);
  z-index: 2;
}

.cg-above-guitar__dot-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  font-size: 4px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #111827;
  text-align: center;
}

.cg-above-guitar__dot.is-a {
  background: #ef4444;
}

.cg-above-guitar__dot.is-b {
  background: #f97316;
}

.cg-above-guitar__dot.is-c {
  background: #facc15;
}

.cg-above-guitar__dot.is-d {
  background: #22c55e;
}

.cg-above-guitar__dot.is-e {
  background: #38bdf8;
}

.cg-above-guitar__dot.is-f {
  background: #6366f1;
}

.cg-above-guitar__dot.is-g {
  background: #a855f7;
}

.cg-above-guitar__dot.is-c .cg-above-guitar__dot-label {
  color: #111827;
}

.cg-above-guitar__dot.is-a .cg-above-guitar__dot-label,
.cg-above-guitar__dot.is-b .cg-above-guitar__dot-label,
.cg-above-guitar__dot.is-d .cg-above-guitar__dot-label,
.cg-above-guitar__dot.is-e .cg-above-guitar__dot-label {
  color: #0f172a;
}

.cg-above-guitar__dot.is-f .cg-above-guitar__dot-label,
.cg-above-guitar__dot.is-g .cg-above-guitar__dot-label {
  color: #ffffff;
}

.cg-above-guitar__dot.is-long-label .cg-above-guitar__dot-label {
  font-size: 3.4px;
  letter-spacing: 0;
}

/* ========================================
   INLINE MINI CHORD TOKENS
   ======================================== */

.song-mini-chord-label,
.song-inline-chord-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid #dbe3f0;
  background: #f8fbff;
  color: #2563eb;
  font-weight: 800;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  box-shadow: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.song-mini-chord-label:hover,
.song-inline-chord-fallback:hover {
  border-color: #bfd2ff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.12);
  transform: translateY(-1px);
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 991.98px) {
  .lyrics-block {
    font-size: 1.04rem;
    line-height: 1.9;
  }
}

@media (max-width: 767.98px) {
  .lyrics-block {
    padding: 16px;
    font-size: 1rem;
    line-height: 1.85;
    border-radius: 16px;
  }

  .lyrics-above-chords {
    height: 0.96em;
  }

  .lyrics-above-chord {
    font-size: 0.74em;
  }

  .lyrics-above-line--clustered {
    margin-bottom: 0.3rem;
  }

  .lyrics-above-clusters {
    gap: 12px;
  }

  .lyrics-chord-cluster__visual {
    min-height: 96px;
    min-width: 78px;
  }

  .lyrics-above-text-segment__top {
    width: 0;
    min-width: 0;
    min-height: 96px;
  }

  .lyrics-above-text-segment__lyric {
    font-size: 0.96rem;
    line-height: 1.35;
  }

  .lyrics-chord-cluster__lyric {
    font-size: 0.96rem;
    line-height: 1.35;
  }

  .cg-above-guitar__name {
    font-size: 11px;
  }

  .cg-above-guitar__shape {
    grid-template-columns: 12px auto;
    column-gap: 5px;
  }

  .cg-above-guitar__shape-left {
    width: 12px;
    height: 46px;
    flex-basis: 12px;
  }

  .cg-above-guitar__side-marker {
    font-size: 9px;
  }

  .cg-above-guitar__shape-main {
    grid-template-columns: 7px 60px;
    column-gap: 5px;
  }

  .cg-above-guitar__nut {
    width: 5px;
    height: 46px;
  }

  .cg-above-guitar__start-fret {
    width: 7px;
    height: 46px;
    font-size: 9px;
  }

  .cg-above-guitar__board {
    width: 60px;
    height: 46px;
  }

  .cg-above-guitar__dot {
    width: 12px;
    height: 12px;
  }

  .cg-above-guitar__dot-label {
    font-size: 3.5px;
    letter-spacing: 0;
  }

  .cg-above-guitar__dot.is-long-label .cg-above-guitar__dot-label {
    display: none;
  }

  .song-mini-chord-label,
  .song-inline-chord-fallback {
    min-height: 18px;
    padding: 2px 6px;
    font-size: 10px;
  }
}

@media (max-width: 575.98px) {
  .lyrics-block {
    font-size: 0.98rem;
  }

  .lyrics-above-lyrics {
    line-height: 1.75;
  }

  .lyrics-above-section,
  .lyrics-inline .lyrics-section,
  .lyrics-plain .lyrics-section {
    font-size: 0.74rem;
    padding: 6px 10px;
  }

  .lyrics-above-line--clustered {
    margin-bottom: 0.25rem;
  }

  .lyrics-above-clusters {
    gap: 10px;
  }

  .lyrics-chord-cluster {
    gap: 4px;
  }

  .lyrics-chord-cluster__visual {
    min-height: 86px;
    min-width: 68px;
  }

  .lyrics-above-text-segment__top {
    width: 0;
    min-width: 0;
    min-height: 86px;
  }

  .lyrics-above-text-segment__lyric {
    font-size: 0.94rem;
    line-height: 1.3;
  }

  .lyrics-chord-cluster__lyric {
    font-size: 0.94rem;
    line-height: 1.3;
  }

  .cg-above-guitar__name {
    font-size: 10px;
  }

  .cg-above-guitar__shape {
    grid-template-columns: 10px auto;
    column-gap: 4px;
  }

  .cg-above-guitar__shape-left {
    width: 10px;
    height: 40px;
    flex-basis: 10px;
  }

  .cg-above-guitar__side-marker {
    font-size: 8px;
  }

  .cg-above-guitar__shape-main {
    grid-template-columns: 6px 52px;
    column-gap: 4px;
  }

  .cg-above-guitar__nut {
    width: 4px;
    height: 40px;
  }

  .cg-above-guitar__start-fret {
    width: 6px;
    height: 40px;
    font-size: 8px;
  }

  .cg-above-guitar__board {
    width: 52px;
    height: 40px;
  }

  .cg-above-guitar__dot {
    width: 11px;
    height: 11px;
  }

  .cg-above-guitar__dot-label {
    font-size: 3px;
    letter-spacing: 0;
  }

  .cg-above-guitar__dot.is-long-label .cg-above-guitar__dot-label {
    display: none;
  }

  .song-mini-chord-label,
  .song-inline-chord-fallback {
    min-height: 17px;
    padding: 2px 6px;
    font-size: 9px;
  }
}

.lyrics-above-text-segment__lyric,
.lyrics-chord-cluster__lyric {
  vertical-align: bottom;
}