body[data-view="story"] #reading-switch,
body[data-view="story"] .notebook,
body[data-view="story"] .player {
  display: none !important;
}
body[data-view="story"] .workspace { grid-template-columns: minmax(0, 1fr); }
body[data-view="story"] main { padding-bottom: 48px; }
body[data-view="lyrics"] .audio-choice,
body[data-view="lyrics"] .page-label,
body[data-view="lyrics"] [data-reading-unit="full"],
body[data-view="lyrics"] .notebook > :not(#lyric-dictionary),
body:not([data-view="lyrics"]) #lyric-dictionary,
body[data-view="lyrics"][data-unit="word"] .phrase-play {
  display: none !important;
}
body[data-view="lyrics"] .reading-switch {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 360px;
  margin: 24px 0 28px;
}
body[data-view="lyrics"] .lyric-line {
  padding: 0 0 28px;
  margin-bottom: 28px;
  border-bottom: 1px solid #ddd4c3;
}
body[data-view="lyrics"] .lyric-line header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}
body[data-view="lyrics"] .word-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
}
body[data-view="lyrics"] .word {
  font-size: 25px;
  line-height: 1.6;
  border-radius: 8px;
  padding: 5px 8px;
}
body[data-view="lyrics"] .line-translation {
  margin: 16px 8px 0;
  color: #766b5a;
  font-size: 15px;
}
body[data-view="lyrics"] .phrase-play {
  background: transparent;
  color: #355b45;
  border: 1px solid #b8c5b7;
  font-size: 13px;
}
body[data-view="lyrics"] .notebook {
  padding: 22px 18px;
  min-height: 220px;
}
#lyric-dictionary h2 {
  margin: 0 0 18px;
  font-size: 16px;
  color: #6f675b;
}
.dictionary-slot {
  min-height: 140px;
}
#word-popover {
  position: relative;
  padding: 22px 18px 18px;
  background: #fffdf7;
  border: 1px solid #d5c9b5;
  border-radius: 12px;
  box-shadow: 0 8px 24px #52442b12;
  overflow-wrap: anywhere;
  max-height: min(70vh, 620px);
  overflow-y: auto;
  overscroll-behavior: contain;
  animation: definition-in .16s ease-out;
}
#definition-word {
  font-family: Georgia, serif;
  font-size: 25px;
  font-weight: 400;
  color: #314f41;
  margin: 4px 0 14px;
}
#definition-meaning {
  margin: 0;
  font-size: 15px;
  line-height: 1.9;
}
.definition-form { margin: 0 0 14px; color: #786b58; font-size: 13px; line-height: 1.8; }
.song-meaning { padding: 12px 14px; background: #fff0cd; border-left: 3px solid #b47b25; border-radius: 6px; color: #805017; }
.song-meaning h4 { margin: 0 0 6px; font-size: 12px; font-weight: 700; }
.dictionary-heading { margin: 22px 0 12px; font-size: 13px; color: #6f675b; }
#definition-lemma { display: block; margin-top: 4px; font-family: Georgia, serif; font-size: 17px; color: #314f41; }
#definition-senses { margin: 0; padding: 0; list-style: none; font-size: 13px; line-height: 1.9; }
#definition-senses li { margin: 0 0 8px; padding: 7px 9px; }
#definition-senses .song-sense { color: #805017; background: #fff0cd; border-radius: 6px; font-weight: 700; }
#definition-attribution { margin: 18px 0 8px; font-size: 11px; color: #786b58; }
#definition-links { display: flex; flex-wrap: wrap; gap: 8px 14px; }
#definition-links a { font-size: 12px; color: #355b45; text-decoration: underline; text-underline-offset: 3px; }
#definition-close {
  position: absolute;
  top: 3px;
  right: 4px;
  width: 32px;
  height: 32px;
  background: transparent;
  font-size: 22px;
  color: #776e60;
}
@keyframes definition-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 900px) {
  body[data-view="lyrics"] .notebook { padding: 0; min-height: 0; margin: 0; border: 0; background: transparent; }
  body[data-view="lyrics"] #lyric-dictionary h2,
  body[data-view="lyrics"] .dictionary-slot { margin: 0; min-height: 0; }
  body[data-view="lyrics"] #lyric-dictionary h2 { display: none; }
  #word-popover { position: fixed; z-index: 30; box-shadow: 0 12px 36px #52442b26; }
  body[data-view="lyrics"] .reading-switch { max-width: none; }
  body[data-view="lyrics"] .word { font-size: 23px; }
}
@media (prefers-reduced-motion: reduce) {
  #word-popover { animation: none; }
}
