/* БИКлауд: список треков и плеер. Цвета и размеры берутся из style.css, так что тёмная тема и тема Telegram работают сами. */
:root { --player-h: 92px; }

/* the player bar sits above the tab bar; everything that floats at the bottom moves up with it */
body.player-on { padding-bottom: calc(var(--nav-h) + var(--player-h) + 24px + env(safe-area-inset-bottom)); }
body.player-on .ai-launcher { bottom: calc(var(--nav-h) + var(--player-h) + 18px + env(safe-area-inset-bottom)); }
body.player-on #toast { bottom: calc(var(--nav-h) + var(--player-h) + 16px + env(safe-area-inset-bottom)); }

.cloud-player {
  position: fixed; left: 0; right: 0;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
  z-index: 5;
  background: var(--bg);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 20px color-mix(in srgb, var(--text) 8%, transparent);
  padding: 8px 16px 6px;
}
.player-inner { max-width: 640px; margin: 0 auto; display: grid; gap: 2px; }
.player-top { display: flex; align-items: center; gap: 4px; }
.player-info { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 0; border: 0; background: none; text-align: left; color: inherit; min-height: 44px; }
.player-text { min-width: 0; display: grid; }
.player-title, .player-artist { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-artist { font-size: 13px; }
.player-seek { display: flex; align-items: center; gap: 8px; }
.wave-scrub { --wave-unplayed: rgba(112, 128, 148, .48); position: relative; flex: 1; min-width: 0; height: 32px; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; }
.wave-scrub::before { content: ""; position: absolute; inset: -9px 0; }
.wave-scrub:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 4px; }
.wave-scrub[aria-disabled="true"] { cursor: default; }
.wave-canvas { display: block; width: 100%; height: 100%; }
@media (prefers-color-scheme: dark) { .wave-scrub { --wave-unplayed: rgba(163, 177, 194, .38); } }
.clock { font-variant-numeric: tabular-nums; font-size: 12px; min-width: 34px; }
.clock:last-child { text-align: right; }

.pbtn { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 50%; background: none; color: var(--text); }
.pbtn:active { background: color-mix(in srgb, var(--hint) 18%, transparent); }
.pbtn.main { background: var(--accent); color: var(--accent-text); width: 44px; height: 44px; }
.pbtn.main:active { background: color-mix(in srgb, var(--accent) 80%, black); }

/* a track's cover is made from its number: no pictures to upload, every track still looks its own */
.cover { position: relative; flex: none; width: 48px; height: 48px; border-radius: 10px; display: grid; place-items: center; overflow: hidden; color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
.player-cover-slot .cover { width: 44px; height: 44px; }
.cover-note { font-size: 22px; line-height: 1; text-shadow: 0 1px 6px rgba(0, 0, 0, .3); }
.eq { position: absolute; inset: 0; display: none; align-items: flex-end; justify-content: center; gap: 3px; padding-bottom: 11px; background: rgba(0, 0, 0, .35); }
.eq i { width: 4px; height: 14px; border-radius: 2px; background: #fff; transform-origin: bottom; animation: eqBar 900ms ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -300ms; }
.eq i:nth-child(3) { animation-delay: -600ms; }
@keyframes eqBar { 0%, 100% { transform: scaleY(.25); } 50% { transform: scaleY(1); } }
.track-row.playing .eq { display: flex; }
.track-row.playing .cover-note { visibility: hidden; }
@media (prefers-reduced-motion: reduce) { .eq i { animation: none; transform: scaleY(.6); } }

.track-list { padding-top: 2px; padding-bottom: 2px; margin-bottom: 64px; /* keeps the last row clear of the floating "ask Dimka" button */ }
.track-row { align-items: center; flex-wrap: wrap; gap: 4px 6px; }
.track-row.current .track-title { color: var(--accent); }
.cloud-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 14px; background: var(--card); margin-bottom: 12px; }
.cloud-tab { min-height: 42px; padding: 0 4px; border: 0; border-radius: 11px; background: none; color: var(--hint); font: inherit; font-weight: 600; font-size: 14px; }
.cloud-tab.active { background: var(--bg); color: var(--text); box-shadow: 0 1px 5px color-mix(in srgb, var(--text) 12%, transparent); }
.cloud-tab:focus-visible, .music-source:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.music-source { color: var(--accent); text-decoration: none; }
/* a found song: the cover, the names and the source on the left, «Добавить» / «▶ Слушать» and what is going on on the right */
.music-row { flex-wrap: nowrap; }
.music-info { cursor: default; }
.music-side { flex: none; display: grid; justify-items: end; gap: 2px; max-width: 42%; }
.music-add { white-space: nowrap; }
.music-status { font-size: 11px; text-align: right; }
.music-status:empty { display: none; }
.track-play { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 0; border: 0; background: none; text-align: left; color: inherit; min-height: 48px; }
.track-text { min-width: 0; display: grid; gap: 1px; }
.track-title, .track-artist, .track-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-artist { color: var(--text); opacity: .75; font-size: 14px; }
.track-sub { font-size: 12px; }
.like { flex: none; display: flex; align-items: center; gap: 4px; min-width: 44px; min-height: 44px; padding: 0 6px; border: 0; border-radius: 12px; background: none; color: var(--hint); font-variant-numeric: tabular-nums; font-size: 14px; }
.like.on { color: var(--danger); }
.like:active { transform: scale(.94); }
.track-tools { flex-basis: 100%; padding: 2px 0 6px 60px; }
.track-edit { flex-basis: 100%; margin: 0; }
.track-edit input { background: var(--bg); }
.pbtn.more { color: var(--hint); width: 36px; }

/* covers: a picture lies over the generated gradient, which shows through if the picture cannot load */
.cover-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover.has-img .cover-note { display: none; }
.cover-pick { display: flex; align-items: center; gap: 10px; }
.cover-pick .cover { width: 56px; height: 56px; background: var(--bg); color: var(--hint); box-shadow: inset 0 0 0 1px var(--line); }
.pinned { margin-bottom: 4px; }
.pinned .track-list { margin-bottom: 8px; }

/* the bar above the tabs opens the big player when tapped; the small grip on top hints at it */
.cloud-player::before { content: ""; position: absolute; top: 3px; left: 50%; width: 34px; height: 3px; margin-left: -17px; border-radius: 2px; background: var(--line); }
.player-info { cursor: pointer; }

/* the big "now playing" screen */
body.sheet-open { overflow: hidden; }
body.sheet-open #toast { z-index: 40; }
.player-sheet { position: fixed; inset: 0; z-index: 30; overflow-y: auto; overscroll-behavior: contain; background: var(--bg); padding: env(safe-area-inset-top) 16px calc(24px + env(safe-area-inset-bottom)); }
.sheet-inner { max-width: 440px; margin: 0 auto; display: grid; gap: 14px; justify-items: stretch; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; min-height: 52px; }
.sheet-head-title { font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--hint); }
.sheet-head-gap { width: 40px; }
.sheet-cover { display: grid; place-items: center; padding: 4px 0 2px; }
.cover.big { width: min(78vw, 320px); height: min(78vw, 320px); border-radius: 20px; box-shadow: 0 14px 34px color-mix(in srgb, var(--text) 18%, transparent), inset 0 0 0 1px rgba(255, 255, 255, .1); }
.cover.big .cover-note { font-size: 96px; }
.sheet-meta { text-align: center; min-width: 0; }
.sheet-title { margin: 4px 0 2px; font-size: 22px; line-height: 1.25; font-weight: 700; letter-spacing: normal; text-transform: none; color: var(--text); overflow-wrap: anywhere; } /* a plain h2 is a small grey caption in this app */
.sheet-artist { margin: 0; color: var(--hint); font-size: 16px; overflow-wrap: anywhere; }
.sheet-seek { display: grid; grid-template-columns: 1fr 1fr; gap: 0 8px; margin-top: 4px; }
.sheet-seek .wave-scrub { grid-column: 1 / -1; grid-row: 1; height: 80px; }
.sheet-seek .clock { grid-row: 2; font-size: 14px; min-width: 36px; }
.sheet-seek .clock:first-child { grid-column: 1; text-align: left; }
.sheet-seek .clock:last-child { grid-column: 2; text-align: right; }
.sheet-controls { display: flex; align-items: center; justify-content: space-between; padding: 0 4px; }
.pbtn.big { width: 52px; height: 52px; }
.pbtn.huge { width: 68px; height: 68px; }
.pbtn.mode { position: relative; color: var(--hint); }
.pbtn.mode.on { color: var(--accent); }
.pbtn.mode.on::after { content: ""; position: absolute; bottom: 3px; left: 50%; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--accent); }
.repeat-badge { position: absolute; top: 5px; right: 3px; font-size: 11px; font-weight: 800; line-height: 1; color: var(--accent); }
.sheet-extra { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.sheet-extra [hidden] { display: none; }
.pill { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 99px; background: none; color: var(--text); font-size: 14px; }
.pill.on { border-color: var(--accent); color: var(--accent); }
.pill.like-big.on { color: var(--danger); border-color: var(--danger); }
.pill[disabled] { opacity: .5; }
.sheet-queue-title { margin: 8px 0 0; font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--hint); }
.sheet-queue { display: grid; }
.queue-item { display: flex; align-items: center; gap: 12px; padding: 8px 0; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; color: inherit; min-height: 56px; }
.queue-item:last-child { border-bottom: 0; }
.cover.small { width: 40px; height: 40px; border-radius: 8px; }
.cover.small .cover-note { font-size: 18px; }

/* the "explicit content" label: a capital E in a rounded square after a title (grey, so it reads in both themes and on a coloured title) */
.explicit-mark { display: inline-grid; place-items: center; flex: none; width: 15px; height: 15px; margin-left: 6px; border-radius: 4px; background: var(--hint); color: var(--bg); vertical-align: 1px; font: 700 10px/1 system-ui, sans-serif; letter-spacing: 0; text-transform: none; }
.track-title:has(> .explicit-mark), .player-title:has(> .explicit-mark) { display: flex; align-items: center; }
.title-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-title .title-text { overflow: visible; white-space: normal; }

/* an artist: a name that opens the artist's page, and the page's header */
.artist-link { cursor: pointer; text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 2px; }
.artist-link:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 3px; }
/* the page of an artist: the avatar on the left; on the right the name and a row of the Play button with the round "+" and the three dots.
   It is a grid and the row ends at the bottom: the bottom of the avatar is the bottom of that row, whatever the width. */
.artist-card { position: relative; isolation: isolate; display: flex; align-items: flex-end; margin: 4px 0 16px; padding: 4px 0; }
.artist-profile { position: relative; z-index: 2; width: 100%; display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 14px; align-items: end; }
/* with a background: the wide picture fills the card, is clear on top and fades into the page below, so the text on it stays readable
   in both themes (the page colour is what it fades to) */
.artist-card.has-bg { min-height: 220px; padding: 20px 14px 18px; border-radius: 22px; }
.artist-card-media { position: absolute; z-index: 0; inset: 0; isolation: isolate; overflow: hidden; border-radius: 22px; pointer-events: none; }
.artist-card-bg { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; pointer-events: none; user-select: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 28%, rgba(0, 0, 0, .92) 44%, rgba(0, 0, 0, .62) 62%, rgba(0, 0, 0, .26) 78%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 28%, rgba(0, 0, 0, .92) 44%, rgba(0, 0, 0, .62) 62%, rgba(0, 0, 0, .26) 78%, transparent 100%); }
.artist-card-media::before { content: ""; position: absolute; z-index: -1; inset: 0; pointer-events: none;
  background: linear-gradient(to bottom, color-mix(in srgb, var(--bg) 4%, transparent) 0%, color-mix(in srgb, var(--bg) 22%, transparent) 34%, color-mix(in srgb, var(--bg) 78%, transparent) 62%, var(--bg) 92%); }
.artist-card.has-bg .artist-info h1 { text-shadow: 0 1px 10px color-mix(in srgb, var(--bg) 85%, transparent); }
.artist-avatar { grid-column: 1; align-self: end; width: 84px; height: 84px; }
.artist-avatar .cover { width: 100%; height: 100%; border-radius: 50%; }
.artist-avatar .cover-note { font-size: 36px; }
.artist-pic { display: block; width: 100%; height: 100%; }
.artist-photo { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; box-shadow: 0 8px 24px rgba(0, 0, 0, .22), inset 0 0 0 1px rgba(255, 255, 255, .12); }
.artist-info { grid-column: 2; align-self: end; min-width: 0; display: grid; gap: 7px; }
.artist-info h1 { margin: 0; font-size: 27px; line-height: 1; font-weight: 800; letter-spacing: -.03em; overflow-wrap: anywhere; }
.artist-head-actions { position: relative; display: flex; align-items: center; gap: 6px; }
.artist-add, .artist-more { flex: none; width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border-radius: 50%; cursor: pointer; }
.artist-add { border: 0; background: var(--accent); color: var(--accent-text); font-size: 24px; font-weight: 300; line-height: 1; }
.artist-more { border: 1px solid color-mix(in srgb, var(--hint) 28%, transparent); background: color-mix(in srgb, var(--bg) 52%, transparent); color: var(--text); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.artist-add:active, .artist-more:active { transform: scale(.94); }
.artist-listen { flex: 1 1 auto; min-width: 0; min-height: 40px; margin: 0; padding: 0 10px; border: 0; border-radius: 14px; background: var(--accent); color: var(--accent-text); font-size: 16px; line-height: 1; font-weight: 600; white-space: nowrap; }
.artist-listen:active { transform: scale(.985); }
@media (max-width: 340px) { .artist-listen { font-size: 14px; } }
/* the way back: a round button in the corner of the header, over the picture */
.artist-back { position: absolute; top: 12px; left: 12px; z-index: 3; width: 36px; height: 36px; display: grid; place-items: center; padding: 0 2px 3px 0; border: 1px solid color-mix(in srgb, var(--hint) 28%, transparent); border-radius: 50%; background: color-mix(in srgb, var(--bg) 52%, transparent); color: var(--text); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); font-size: 26px; line-height: 1; cursor: pointer; }
.artist-back:active { transform: scale(.94); }
.artist-card:not(.has-bg) { padding-top: 46px; }
.artist-card.empty { min-height: 40px; padding: 0; margin-bottom: 8px; }
.artist-card.empty .artist-back { position: static; }
/* above the list of the tracks: "Tracks 4" on the left, the likes and listeners on the right */
.artist-list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 6px; }
.artist-list-head h2 { margin: 0; }
.artist-count { color: var(--text); }
/* the menu of the three dots opens upward, over the card */
.artist-tools-menu { position: absolute; right: 0; bottom: calc(100% + 9px); z-index: 10; width: 210px; max-width: calc(100vw - 32px); overflow: hidden; padding: 5px; border: 1px solid color-mix(in srgb, var(--hint) 24%, transparent); border-radius: 16px; background: color-mix(in srgb, var(--bg) 88%, transparent); box-shadow: 0 12px 40px rgba(0, 0, 0, .28); -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px); }
.artist-tools-menu button { width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: 11px; background: none; color: var(--text); text-align: left; font-weight: 500; }
.artist-tools-menu button:active { background: color-mix(in srgb, var(--hint) 14%, transparent); }
.artist-tools-menu button.danger { color: var(--danger); }
.artist-pick { display: grid; gap: 4px; }
.artist-pick .chips { margin: 0; }

/* ---------- the form of a new track: a sheet over the page ---------- */
.track-sheet { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; overscroll-behavior: contain; background: rgba(0, 0, 0, .45); }
.track-sheet[hidden] { display: none; }
.sheet-surface { width: min(100%, 520px); max-height: 92vh; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain; display: grid; gap: 12px; padding: 8px 16px calc(16px + env(safe-area-inset-bottom)); background: var(--bg); border-radius: 22px 22px 0 0; box-shadow: 0 -10px 40px rgba(0, 0, 0, .25); }
.sheet-grab { justify-self: center; width: 36px; height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--hint) 45%, transparent); }
.sheet-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet-top h2 { margin: 0; font-size: 20px; line-height: 1.2; font-weight: 700; letter-spacing: -.01em; text-transform: none; color: var(--text); }
.sheet-hint { font-size: 13px; line-height: 1.3; color: var(--hint); }
.sheet-link { flex: none; min-height: 36px; padding: 0 4px; border: 0; background: none; color: var(--link); font-size: 15px; font-weight: 600; cursor: pointer; }
.sheet-link.quiet { font-weight: 500; color: var(--hint); }
.sheet-link:active { opacity: .6; }
@media (prefers-reduced-motion: no-preference) {
  .track-sheet:not([hidden]) { animation: sheet-fade .2s ease-out; }
  .track-sheet:not([hidden]) .sheet-surface { animation: sheet-rise .2s ease-out; }
}
@keyframes sheet-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheet-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* the file: a calm zone, then one line */
.file-zone { width: 100%; display: grid; justify-items: center; align-content: center; gap: 3px; padding: 10px 14px; border: 1.5px dashed color-mix(in srgb, var(--hint) 45%, transparent); border-radius: 18px; background: none; color: var(--text); text-align: center; cursor: pointer; }
.file-zone strong { font-size: 16px; }
.file-zone:active { background: color-mix(in srgb, var(--hint) 10%, transparent); }
.file-action { margin-top: 4px; padding: 6px 16px; border-radius: 99px; background: var(--accent); color: var(--accent-text); font-size: 14px; font-weight: 600; }
.file-badge { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.file-badge.small { width: 34px; height: 34px; }
.file-chosen { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 0 4px; }
.file-text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }

/* the fields */
.field { width: 100%; height: 52px; padding: 0 16px; border: 1px solid transparent; border-radius: 14px; background: var(--card); color: var(--text); font-size: 16px; }
.field::placeholder { color: var(--hint); }
.field:focus { outline: none; border-color: var(--accent); }
.artist-pick { display: grid; gap: 6px; margin-top: -4px; }
.artist-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.artist-chip { min-height: 30px; padding: 0 12px; border: 1px solid var(--line); border-radius: 99px; background: none; color: var(--text); font-size: 13px; cursor: pointer; }
.artist-chip:active { background: color-mix(in srgb, var(--hint) 14%, transparent); }

/* the rows: Explicit with a switch, the cover */
.sheet-row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 6px 4px; border-top: 1px solid var(--line); }
.sheet-row-text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.sheet-row-text strong { font-size: 15px; font-weight: 600; }
.sheet-row .cover-preview { width: 44px; height: 44px; border-radius: 10px; background: var(--card); color: var(--hint); box-shadow: none; flex: none; }
.explicit-mark.big { width: 24px; height: 24px; margin: 0; border-radius: 6px; font-size: 14px; flex: none; }
.switch-row { cursor: pointer; }
.switch { position: relative; flex: none; width: 50px; height: 30px; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.switch-track { position: absolute; inset: 0; border-radius: 15px; background: color-mix(in srgb, var(--hint) 38%, transparent); transition: background .2s; pointer-events: none; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s; }
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(20px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--link); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .switch-track, .switch-track::after { transition: none; } }

/* the limits are quiet, the one main button is not */
.sheet-limits { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 12.5px; line-height: 1.3; color: var(--hint); }
.sheet-limits svg { flex: none; }
.track-sheet progress { width: 100%; height: 6px; accent-color: var(--accent); }
.sheet-send { width: 100%; min-height: 54px; margin: 0; border: 0; border-radius: 16px; font-size: 17px; font-weight: 700; }

/* the words of the playing track (lyrics.js): a screen over the big player */
body.lyrics-open { overflow: hidden; }
body.lyrics-open #toast { z-index: 40; }
.lyrics-screen { position: fixed; inset: 0; z-index: 35; background: var(--bg); padding: env(safe-area-inset-top) 16px env(safe-area-inset-bottom); }
.lyrics-screen[hidden] { display: none; }
.lyrics-inner { position: relative; max-width: 520px; height: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; }
.lyrics-head { flex: none; display: flex; align-items: center; gap: 8px; min-height: 52px; }
.lyrics-head [hidden] { display: block; visibility: hidden; } /* the place of the menu button stays: the names keep the middle */
.lyrics-names { flex: 1; min-width: 0; display: grid; text-align: center; }
.lyrics-names > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lyrics-menu {
  position: absolute; z-index: 1; top: 52px; inset-inline-end: 0; width: min(270px, 100%);
  max-height: calc(100% - 60px); overflow-y: auto; padding: 5px; border: 1px solid var(--line);
  border-radius: 14px; background: var(--card); box-shadow: 0 8px 24px #0004;
}
.lyrics-menu[hidden] { display: none; }
.lyrics-menu-item {
  display: flex; align-items: center; gap: 11px; width: 100%; min-height: 46px;
  padding: 6px 10px; border: 0; border-radius: 9px; background: none; color: var(--text);
  font: inherit; font-size: 14px; font-weight: 600; text-align: start; cursor: pointer;
}
.lyrics-menu-item:hover, .lyrics-menu-item:active { background: color-mix(in srgb, var(--hint) 12%, transparent); }
.lyrics-menu-item svg { flex: none; color: var(--hint); }
.lyrics-menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px; }
.lyrics-language-summary { display: block; font-weight: 400; overflow-wrap: anywhere; }
.lyrics-language-summary:empty { display: none; }
.lyrics-translation-status { margin: 0; overflow-wrap: anywhere; }
.lyrics-translation-status.error { color: var(--danger); }
.lyrics-translation-options {
  position: fixed; inset: auto 0 0; margin: 0 auto; width: min(100%, 520px); max-width: none;
  max-height: min(75dvh, 100%); padding: 8px 16px calc(14px + env(safe-area-inset-bottom));
  border: 1px solid var(--line); border-radius: 20px 20px 0 0; background: var(--card); color: var(--text);
}
.lyrics-translation-options::backdrop { background: #0006; }
.lyrics-translation-head { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.lyrics-language-options { display: grid; gap: 4px; }
.lyrics-language-options .btn {
  display: flex; justify-content: space-between; align-items: center; min-height: 44px;
  width: 100%; margin: 0; padding-inline: 12px; border-color: transparent; text-align: start;
}
.lyrics-language-options .btn svg { visibility: hidden; }
.lyrics-language-options .btn[aria-pressed="true"] { color: var(--text); background: color-mix(in srgb, var(--accent) 15%, var(--card)); }
.lyrics-language-options .btn[aria-pressed="true"] svg { visibility: visible; color: var(--accent); }
.lyrics-translation-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.lyrics-translation-actions .btn { min-height: 44px; margin: 0; }
.lyrics-translation-actions .btn:first-child { flex: 1; }
.lyrics-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 6px 2px 38vh; scrollbar-width: none; }
.lyrics-body::-webkit-scrollbar { display: none; }
.lyrics-lines { display: grid; gap: 2px; }
.lyrics-lines:not(.marking) { padding-inline-end: 4%; } /* room for the highlighted line's scale */
.lyrics-line { display: block; width: 100%; margin: 0; padding: 8px 10px; border: 0; border-radius: 10px; background: none; color: var(--hint); font: inherit; font-size: 21px; font-weight: 700; line-height: 1.3; text-align: left; overflow-wrap: anywhere; transform-origin: left center; transition: color 220ms ease, opacity 220ms ease, transform 220ms ease; }
button.lyrics-line { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button.lyrics-line:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.lyrics-line.past { opacity: .45; }
.lyrics-line.on { color: var(--text); opacity: 1; transform: scale(1.04); }
.lyrics-line.pause { font-weight: 400; }
.lyrics-plain p { margin: 0 0 6px; font-size: 17px; line-height: 1.45; overflow-wrap: anywhere; }
.lyrics-plain p.gap { height: 12px; margin: 0; }
.lyrics-line-translations { display: grid; gap: 3px; margin-top: 5px; font-size: .75em; line-height: 1.4; font-weight: 500; }
.lyrics-line.on .lyrics-line-translations { color: var(--hint); }
.lyrics-plain .lyrics-line-translations { color: var(--hint); margin-bottom: 12px; }
.lyrics-note { margin: 0 0 10px; }
.lyrics-source { margin: 18px 0 0; font-size: 12px; }
.lyrics-banner { margin: 0 0 10px; }
.lyrics-empty { display: grid; justify-items: center; gap: 10px; padding-top: 12vh; text-align: center; }
.lyrics-area { min-height: 46vh; resize: vertical; font-size: 16px; line-height: 1.4; }
.lyrics-foot { flex: none; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; padding: 8px 0 12px; border-top: 1px solid var(--line); }
.lyrics-shift { display: flex; align-items: center; gap: 5px; justify-content: center; padding: 5px; }
.lyrics-shift .meta { flex: 1; text-align: center; font-variant-numeric: tabular-nums; }
.lyrics-mark-top { flex: 1 1 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.lyrics-mark-top .link-action { width: auto; margin: 0; padding: 6px 0; border: 0; }
.lyrics-mark-top .link-action[disabled] { opacity: .45; }
.lyrics-next { flex: 1 1 100%; min-height: 64px; font-size: 18px; }
.lyrics-foot > .actions { flex: 1 1 100%; margin: 0; }
.lyrics-lines.marking .lyrics-line { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 17px; transform: none; }
.lyrics-stamp { flex: none; color: var(--hint); font-size: 13px; font-weight: 400; font-variant-numeric: tabular-nums; }
.lyrics-timing-list { display: grid; gap: 2px; }
.lyrics-timing-row {
  display: grid; grid-template-columns: 5.4ch minmax(0, 1fr); align-items: baseline; gap: 12px;
  width: 100%; min-height: 44px; padding: 9px; border: 0; border-radius: 9px;
  background: none; color: var(--text); font: inherit; text-align: start; overflow-wrap: anywhere; cursor: pointer;
}
.lyrics-timing-row:hover { background: var(--card); }
.lyrics-timing-row.lyrics-timing-selected { background: color-mix(in srgb, var(--accent) 14%, var(--card)); }
.lyrics-timing-row[aria-current="true"] { box-shadow: inset 0 0 0 1px var(--accent); font-weight: 700; }
.lyrics-timing-row[aria-current="true"] .lyrics-stamp { color: var(--text); font-weight: 700; }
.lyrics-timing-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.lyrics-timing-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; width: 100%; }
.lyrics-timing-position { display: grid; justify-items: start; flex: 1 1 auto; }
.lyrics-timing-clock { color: var(--text); font-size: 18px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.lyrics-timing-adjust > .lyrics-timing-controls { width: auto; flex-wrap: nowrap; }
.lyrics-timing-controls input { width: 78px; min-height: 44px; text-align: center; font-variant-numeric: tabular-nums; }
.lyrics-timing-controls .btn { margin: 0; min-height: 44px; }
.lyrics-timing-controls .lyrics-timing-toggle { min-width: 76px; }
.lyrics-timing-message { margin: 0; width: 100%; color: var(--danger); }
.lyrics-timing-message:empty { display: none; }
@media (prefers-reduced-motion: reduce) { .lyrics-line { transition: none; } .lyrics-line.on { transform: none; } }
