/*
 * Pebble design (adapted from the owner's shared design system, bookmarks-newtab/src/design/designs/pebble.css):
 * tonal cards tinted in their own hue, generous radii, round pebbles for covers and icons, Onest everywhere,
 * pine-green accent in light and mint in dark. Surfaces and text follow Telegram's theme params (set by app.js),
 * everything else is derived from them with color-mix so contrast holds in any Telegram theme.
 */

@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('./fonts/onest-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('./fonts/onest-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

:root {
  --font: 'Onest', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --bg: #eef0ec;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --fg: #1b1d1f;
  --accent: #17785c;
  --accent-hover: #12684f;
  --accent-fg: #ffffff;
  --accent-soft: #dcefe7;
  --accent-ring: rgba(23, 120, 92, 0.35);
  --mark: #0f5f48;
  --mark-bg: #d4eee3;
  --danger: #c8281c;
  --pebble: #ffffff;
  --cover-ring: var(--pebble);
  --shadow-sm: 0 1px 2px rgba(27, 29, 31, 0.08);
  --shadow-md: 0 1px 2px rgba(27, 29, 31, 0.05), 0 10px 28px -14px rgba(27, 29, 31, 0.22);
  --shadow-lg: 0 0 0 1px rgba(27, 29, 31, 0.06), 0 34px 90px -26px rgba(27, 29, 31, 0.5);
  --backdrop: rgba(24, 26, 24, 0.32);
  --hue-0: #e5544b; --hue-0-ink: #a92b23;
  --hue-1: #e8743b; --hue-1-ink: #9a3f12;
  --hue-2: #e5b316; --hue-2-ink: #735300;
  --hue-3: #34a065; --hue-3-ink: #176a3e;
  --hue-4: #1fa39b; --hue-4-ink: #0b5e59;
  --hue-5: #2a9bd6; --hue-5-ink: #0b5a85;
  --hue-6: #3d6fe0; --hue-6-ink: #1d4bb0;
  --hue-7: #8a6ce8; --hue-7-ink: #5235b3;
  --hue-8: #b45bc4; --hue-8-ink: #7e2d8c;
  --hue-9: #e0548c; --hue-9-ink: #a2245a;
  --tint-amount: 15%;
  --radius-card: 24px;
  --radius-md: 14px;
  --pill: 999px;
  --dur: 160ms;
  --ease: cubic-bezier(0.2, 0.8, 0.25, 1);
  --safe-top: 0px;
  --safe-bottom: 0px;
  --safe-left: 0px;
  --safe-right: 0px;
  --tabs-h: 68px;
  --mini-h: 0px;
  color-scheme: light;
}

:root[data-theme='dark'] {
  --bg: #121314;
  --surface: #1c1d20;
  --surface-raised: #202125;
  --fg: #eceeef;
  --accent: #4fd1a5;
  --accent-hover: #67dbb4;
  --accent-fg: #06261b;
  --accent-soft: #1f3a31;
  --accent-ring: rgba(79, 209, 165, 0.45);
  --mark: #8ff0cb;
  --mark-bg: #1f3a31;
  --danger: #ff6a5c;
  --pebble: #e9ebec;
  --cover-ring: rgba(255, 255, 255, 0.12);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 30px -14px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 34px 90px -26px rgba(0, 0, 0, 0.85);
  --backdrop: rgba(0, 0, 0, 0.5);
  --hue-0-ink: #ff9f97;
  --hue-1-ink: #ffb48a;
  --hue-2-ink: #f3d06a;
  --hue-3-ink: #8ad8a9;
  --hue-4-ink: #7dd9d1;
  --hue-5-ink: #8fd0f5;
  --hue-6-ink: #a3bdff;
  --hue-7-ink: #c4b3ff;
  --hue-8-ink: #e3a6ee;
  --hue-9-ink: #ffa3c6;
  --tint-amount: 24%;
  color-scheme: dark;
}

:root {
  --fg-2: color-mix(in srgb, var(--fg) 80%, var(--surface));
  --fg-3: color-mix(in srgb, var(--fg) 64%, var(--surface));
  --line: color-mix(in srgb, var(--fg) 9%, transparent);
  --fill: color-mix(in srgb, var(--fg) 6%, transparent);
  --fill-2: color-mix(in srgb, var(--fg) 10%, transparent);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

body { overscroll-behavior-y: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
img { display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent-ring); outline-offset: 2px; }

.app {
  min-height: 100vh;
  padding-top: calc(var(--safe-top) + 4px);
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
}

.topbar {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 14px 20px 10px;
}
.topbar__title { margin: 0; font-size: 30px; font-weight: 720; letter-spacing: -0.02em; }
.topbar__meta { color: var(--fg-3); font-size: 15px; font-weight: 500; }

.view {
  padding: 0 14px calc(var(--tabs-h) + var(--mini-h) + var(--safe-bottom) + 36px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ---------- Pebbles, covers, icons ---------- */

.icon { width: 22px; height: 22px; flex: none; }
.pebble {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--mark);
}
.cover {
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--fill-2);
  box-shadow: 0 0 0 3px var(--cover-ring), var(--shadow-sm);
}
.cover--placeholder {
  display: grid;
  place-items: center;
  color: var(--tone-deep, var(--mark));
  background: var(--tone-tint, var(--accent-soft));
}

/* ---------- Cards ---------- */

.card {
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-md);
  padding: 16px;
}
.card--list { padding: 6px; }
.card__title { margin: 0 0 12px; font-size: 18px; font-weight: 680; }
.card__hint { margin: 6px 0 0; color: var(--fg-3); font-size: 14px; }
.section-label { margin: 6px 6px -4px; color: var(--fg-3); font-size: 14px; font-weight: 600; }

.tcard {
  --tone: var(--hue-5);
  --tone-ink: var(--hue-5-ink);
  background: color-mix(in srgb, var(--tone) var(--tint-amount), var(--surface));
  border-radius: var(--radius-card);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-sm);
}
.tcard__title { margin: 0; font-size: 17px; font-weight: 680; color: var(--tone-ink); line-height: 1.25; }
.tcard__meta { color: var(--fg-2); font-size: 14px; }
.tcard__reason { display: flex; gap: 6px; align-items: flex-start; color: var(--fg-2); font-size: 14px; }
.tcard__reason .icon { width: 18px; height: 18px; color: var(--tone-ink); margin-top: 1px; }
.tcard__error {
  align-self: flex-start;
  padding: 6px 12px;
  border-radius: var(--pill);
  background: color-mix(in srgb, var(--danger) 16%, var(--surface));
  color: var(--fg);
  font-size: 14px;
  font-weight: 600;
}
.tcard__actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tcard.is-dismissed { opacity: 0.55; }

.thumb {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: color-mix(in srgb, var(--tone) 30%, var(--surface));
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb__play {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--pebble);
  color: #1b1d1f;
  box-shadow: var(--shadow-md);
}

/* ---------- Search ---------- */

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 58px;
  padding: 0 8px;
  border-radius: var(--pill);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}
.search:focus-within { box-shadow: 0 0 0 3px var(--accent-ring), var(--shadow-md); }
.search .pebble { width: 42px; height: 42px; }
.search__input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 17px;
  height: 100%;
}
.search__input::placeholder { color: var(--fg-3); }
.search__input::-webkit-search-cancel-button { display: none; }

mark {
  margin: 0 -1px;
  padding: 1px 3px;
  border-radius: 6px;
  background: var(--mark-bg);
  color: var(--mark);
  font-weight: 650;
}

/* ---------- Rows ---------- */

.list { display: flex; flex-direction: column; gap: 2px; }
.row {
  --row-color: var(--accent);
  display: flex;
  align-items: center;
  gap: 4px;
  border-radius: var(--pill);
  padding: 4px;
  transition: background var(--dur) var(--ease);
}
.row.is-playing {
  background: color-mix(in srgb, var(--row-color) 16%, var(--surface));
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--row-color) 45%, transparent);
}
.row__main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 8px 6px 6px;
  text-align: left;
  border-radius: var(--pill);
}
.row__main:active { background: var(--fill); }
.row__text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row__title { font-size: 16.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row.is-playing .row__title { color: var(--tone-deep, var(--fg)); }
.row__meta { color: var(--fg-3); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row__eq { display: none; color: var(--tone-deep, var(--mark)); }
.row.is-playing .row__eq { display: inline-flex; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: var(--pill);
  font-weight: 620;
  font-size: 16px;
  background: var(--fill);
  color: var(--fg);
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease);
  user-select: none;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; pointer-events: none; }
.btn--primary { background: var(--accent); color: var(--accent-fg); }
.btn--soft { background: var(--accent-soft); color: var(--mark); }
.btn--ghost { background: transparent; color: var(--fg-2); }
.btn--danger { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.btn--block { width: 100%; }
.btn--small { min-height: 40px; padding: 0 16px; font-size: 15px; }
.btn--icon { width: 44px; min-height: 44px; padding: 0; flex: none; }
.btn--icon.btn--ghost { color: var(--fg-3); }
.btn--on-tone { background: color-mix(in srgb, var(--surface) 70%, transparent); color: var(--tone-ink, var(--fg)); }

.hero-button {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-height: 84px;
  padding: 14px 22px 14px 14px;
  border-radius: var(--pill);
  background: var(--accent);
  color: var(--accent-fg);
  font-size: 20px;
  font-weight: 700;
  box-shadow: var(--shadow-md);
  text-align: left;
}
.hero-button .pebble { width: 56px; height: 56px; background: color-mix(in srgb, var(--accent-fg) 18%, transparent); color: var(--accent-fg); }
.hero-button small { display: block; font-size: 14px; font-weight: 500; opacity: 0.85; }
.hero-button:active { transform: scale(0.98); }

/* ---------- Fields ---------- */

.field {
  width: 100%;
  min-height: 52px;
  padding: 0 18px;
  border: 0;
  outline: none;
  border-radius: var(--radius-md);
  background: var(--fill);
  font-size: 16px;
}
.field:focus { background: var(--surface); box-shadow: 0 0 0 3px var(--accent-ring); }
.field-label { display: block; margin: 0 0 6px 4px; color: var(--fg-3); font-size: 14px; font-weight: 550; }
.field-row { display: flex; gap: 8px; align-items: center; }
.field-row .field { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }

/* ---------- Segmented, switch, progress ---------- */

.segmented {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: var(--pill);
  background: var(--fill);
  overflow-x: auto;
  scrollbar-width: none;
}
.segmented::-webkit-scrollbar { display: none; }
.segmented__option {
  flex: 1;
  min-height: 42px;
  padding: 0 14px;
  border-radius: var(--pill);
  font-weight: 600;
  font-size: 15px;
  color: var(--fg-2);
  white-space: nowrap;
}
.segmented__option[aria-checked='true'] { background: var(--surface); color: var(--fg); box-shadow: var(--shadow-sm); }
.segmented--accent .segmented__option[aria-checked='true'] { background: var(--accent); color: var(--accent-fg); }
.segmented--days { width: 100%; }
.segmented--days .segmented__option { padding: 0; min-width: 0; }
.segmented--grid { display: grid; grid-template-columns: repeat(3, 1fr); border-radius: 26px; }

.setting {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 6px 0;
}
.setting + .setting { border-top: 1px solid var(--line); }
.setting__text { flex: 1; min-width: 0; }
.setting__label { font-weight: 600; }
.setting__hint { color: var(--fg-3); font-size: 14px; }

.switch {
  position: relative;
  flex: none;
  width: 54px;
  height: 32px;
  border-radius: var(--pill);
  background: var(--fill-2);
  transition: background var(--dur) var(--ease);
}
.switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--pebble);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease);
}
.switch[aria-checked='true'] { background: var(--accent); }
.switch[aria-checked='true']::after { transform: translateX(22px); background: #ffffff; }

.progress { height: 10px; border-radius: var(--pill); background: var(--fill-2); overflow: hidden; }
.progress__bar { height: 100%; width: 0; border-radius: var(--pill); background: var(--accent); transition: width 300ms var(--ease); }
.progress--indeterminate .progress__bar { width: 35%; animation: slide 1.2s var(--ease) infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(300%); } }

.time-input { width: 120px; flex: none; text-align: center; }

/* ---------- Jobs ---------- */

.job { display: flex; gap: 12px; align-items: center; padding: 10px 6px; }
.job + .job { border-top: 1px solid var(--line); }
.job__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.job__title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job__stage { color: var(--fg-3); font-size: 14px; }
.job--error .job__stage { color: var(--danger); }
.job--done .pebble { background: var(--accent); color: var(--accent-fg); }

/* ---------- Empty and loading ---------- */

.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 28px 16px; }
.empty .pebble { width: 72px; height: 72px; }
.empty .pebble .icon { width: 32px; height: 32px; }
.empty__title { margin: 0; font-size: 19px; font-weight: 680; }
.empty__text { margin: 0; color: var(--fg-3); max-width: 300px; }
.skeleton { border-radius: var(--radius-card); background: var(--fill); height: 260px; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.55; } }

/* ---------- Tabs ---------- */

.tabs {
  position: fixed;
  left: calc(10px + var(--safe-left));
  right: calc(10px + var(--safe-right));
  bottom: calc(10px + var(--safe-bottom));
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: var(--tabs-h);
  padding: 6px;
  border-radius: 34px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-lg);
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-radius: 28px;
  color: var(--fg-3);
  font-size: 11.5px;
  font-weight: 600;
}
.tab .tab__pebble { display: grid; place-items: center; width: 44px; height: 30px; border-radius: var(--pill); }
.tab[aria-current='page'] { color: var(--fg); }
.tab[aria-current='page'] .tab__pebble { background: var(--accent-soft); color: var(--mark); }

/* ---------- Mini player ---------- */

.mini {
  --row-color: var(--accent);
  position: fixed;
  left: calc(14px + var(--safe-left));
  right: calc(14px + var(--safe-right));
  bottom: calc(var(--tabs-h) + 18px + var(--safe-bottom));
  z-index: 19;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 6px 6px;
  border-radius: var(--pill);
  background: color-mix(in srgb, var(--row-color) 20%, var(--surface-raised));
  box-shadow: var(--shadow-lg);
}
.mini .cover { width: 46px; height: 46px; }
.mini__open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; text-align: left; }
.mini__text { flex: 1; min-width: 0; display: flex; flex-direction: column; text-align: left; }
.mini__title { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--tone-deep, var(--fg)); }
.mini__meta { font-size: 13.5px; color: var(--fg-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini__progress { position: absolute; left: 26px; right: 26px; bottom: 2px; height: 3px; border-radius: 2px; background: transparent; }
.mini__progress span { display: block; height: 100%; width: 0; border-radius: 2px; background: var(--tone-deep, var(--accent)); }
.play-pebble { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-fg); flex: none; }
.play-pebble--big { width: 76px; height: 76px; }
.play-pebble--big .icon { width: 34px; height: 34px; }

/* ---------- Overlays: sheet, full player, toast ---------- */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--backdrop);
  display: flex;
  align-items: flex-end;
  animation: fade var(--dur) var(--ease);
}
@keyframes fade { from { opacity: 0; } }
.sheet {
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  padding: 10px 18px calc(22px + var(--safe-bottom));
  border-radius: 30px 30px 0 0;
  background: var(--surface-raised);
  box-shadow: var(--shadow-lg);
  animation: rise 220ms var(--ease);
}
@keyframes rise { from { transform: translateY(40px); opacity: 0.4; } }
.sheet__grip { width: 40px; height: 5px; border-radius: 3px; background: var(--fill-2); margin: 0 auto 12px; }
.sheet__title { margin: 0 0 14px; font-size: 21px; font-weight: 700; }
.sheet__actions { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.sheet__head { display: flex; gap: 14px; align-items: center; margin-bottom: 8px; }
.sheet__head .cover { width: 64px; height: 64px; }
.sheet__song-title { font-size: 18px; font-weight: 680; color: var(--tone-deep, var(--fg)); }
.sheet__song-meta { color: var(--fg-2); }
.details { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.chip { padding: 4px 10px; border-radius: var(--pill); background: var(--fill-2); color: var(--fg-2); font-size: 13.5px; font-weight: 600; }
.chip--tone { background: var(--tone-tint, var(--accent-soft)); color: var(--tone-deep, var(--mark)); }

.player {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  padding: calc(var(--safe-top) + 10px) calc(20px + var(--safe-right)) calc(20px + var(--safe-bottom)) calc(20px + var(--safe-left));
  background: linear-gradient(180deg, var(--tone-tint, var(--accent-soft)) 0%, var(--bg) 78%);
  animation: rise 240ms var(--ease);
}
.player__top { display: flex; align-items: center; justify-content: space-between; min-height: 48px; }
.player__label { font-size: 14px; font-weight: 600; color: var(--fg-2); }
.player__stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 12px 0; overflow: hidden; }
.player__cover {
  width: min(78vw, 46vh, 380px);
  aspect-ratio: 1;
  border-radius: 32px;
  object-fit: cover;
  background: var(--tone-tint, var(--fill-2));
  box-shadow: 0 30px 60px -28px rgba(0, 0, 0, 0.55);
}
.player__title { margin: 0; font-size: 24px; font-weight: 720; color: var(--tone-deep, var(--fg)); line-height: 1.2; }
.player__artist { margin: 4px 0 0; font-size: 17px; color: var(--fg-2); }
.player__seek { margin-top: 18px; }
.player__times { display: flex; justify-content: space-between; color: var(--fg-3); font-size: 13.5px; font-variant-numeric: tabular-nums; margin-top: 4px; }
.player__controls { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.player__controls .btn--icon { width: 54px; min-height: 54px; color: var(--fg); }
.player__controls .btn--icon.is-on { background: var(--tone-tint, var(--accent-soft)); color: var(--tone-deep, var(--mark)); }

.range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 28px;
  background: transparent;
  --fill-pct: 0%;
}
.range::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: var(--pill);
  background: linear-gradient(90deg, var(--tone-deep, var(--accent)) var(--fill-pct), var(--fill-2) var(--fill-pct));
}
.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  margin-top: -7px;
  border-radius: 50%;
  background: var(--pebble);
  box-shadow: var(--shadow-md);
}
.range::-moz-range-track { height: 8px; border-radius: var(--pill); background: var(--fill-2); }
.range::-moz-range-progress { height: 8px; border-radius: var(--pill); background: var(--tone-deep, var(--accent)); }
.range::-moz-range-thumb { width: 22px; height: 22px; border: 0; border-radius: 50%; background: var(--pebble); }

.lyrics {
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow-y: auto;
  padding: 18vh 4px 30vh;
  scrollbar-width: none;
  mask-image: linear-gradient(180deg, transparent 0, #000 14%, #000 80%, transparent 100%);
}
.lyrics::-webkit-scrollbar { display: none; }
.lyrics__line {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 14px;
  margin: 2px 0;
  border-radius: 20px;
  font-size: 23px;
  font-weight: 680;
  line-height: 1.3;
  color: var(--fg-3);
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.lyrics__line.is-past { color: var(--fg-2); }
.lyrics__line.is-current {
  color: var(--tone-deep, var(--mark));
  background: color-mix(in srgb, var(--row-color, var(--accent)) 26%, var(--surface));
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--row-color, var(--accent)) 45%, transparent);
}
.lyrics__plain { white-space: pre-wrap; font-size: 19px; line-height: 1.55; font-weight: 550; padding: 0 6px; }
.lyrics-wrap { position: relative; width: 100%; height: 100%; min-height: 0; align-self: stretch; display: flex; flex-direction: column; }
.lyrics-tools { display: flex; align-items: center; justify-content: center; gap: 8px; padding-top: 6px; }
.lyrics-tools__value { min-width: 76px; text-align: center; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--fg-2); }
.lyrics-empty { margin: auto; text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; }

.toast-root {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: calc(var(--tabs-h) + var(--mini-h) + 26px + var(--safe-bottom));
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 520px;
  width: 100%;
  min-height: 52px;
  padding: 6px 6px 6px 20px;
  border-radius: var(--pill);
  background: var(--fg);
  color: var(--surface);
  box-shadow: var(--shadow-lg);
  font-weight: 560;
  animation: rise 200ms var(--ease);
}
.toast__text { flex: 1; min-width: 0; }
.toast__action { min-height: 40px; padding: 0 16px; border-radius: var(--pill); background: color-mix(in srgb, var(--surface) 16%, transparent); color: var(--surface); font-weight: 680; }

.note { padding: 14px 16px; border-radius: 20px; background: var(--accent-soft); color: var(--mark); font-size: 14.5px; }
.note strong { font-weight: 700; }
.muted { color: var(--fg-3); }
.danger-text { color: var(--danger); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
