:root {
  --bg: var(--tg-theme-bg-color, #17212b);
  --fg: var(--tg-theme-text-color, #f5f5f5);
  --hint: var(--tg-theme-hint-color, #8a99a8);
  --card: var(--tg-theme-secondary-bg-color, #232e3c);
  --accent: var(--tg-theme-button-color, #5288c1);
  --accent-fg: var(--tg-theme-button-text-color, #fff);
}
* { box-sizing: border-box; margin: 0; }
body {
  font: 16px/1.45 -apple-system, Roboto, "Segoe UI", sans-serif;
  background: var(--bg); color: var(--fg); padding-bottom: 24px;
}
#tabs {
  position: sticky; top: 0; z-index: 5; display: flex;
  background: var(--card); border-bottom: 1px solid rgba(128,128,128,.25);
}
#tabs button {
  flex: 1; padding: 12px 0; font-size: 22px; background: none;
  border: none; border-bottom: 3px solid transparent; cursor: pointer;
}
#tabs button.active { border-bottom-color: var(--accent); }
main { padding: 12px; max-width: 560px; margin: 0 auto; }
.tab { display: none; }
.tab.active { display: block; }
h2 { font-size: 18px; margin: 8px 0; }
h3 { font-size: 15px; margin: 14px 0 6px; color: var(--hint); }
.card {
  background: var(--card); border-radius: 12px; padding: 12px;
  margin-bottom: 10px; white-space: pre-line;
}
.row { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.row:last-child { margin-bottom: 0; }
button, select, input {
  font: inherit; color: var(--fg); background: var(--bg);
  border: 1px solid rgba(128,128,128,.35); border-radius: 10px;
  padding: 8px 12px;
}
button { cursor: pointer; }
button.primary { background: var(--accent); color: var(--accent-fg); border: none; }
button:disabled { opacity: .5; }
input { flex: 1; min-width: 120px; }
.hint { color: var(--hint); font-size: 13px; margin: 6px 2px; }
#covers-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cover { background: var(--card); border-radius: 12px; overflow: hidden; }
.cover img { width: 100%; aspect-ratio: 9/16; object-fit: cover; display: block; }
.cover .meta { padding: 6px 8px; font-size: 12px; color: var(--hint); }
.cover .row { padding: 0 8px 8px; margin: 0; }
.cover button { flex: 1; padding: 6px 0; font-size: 18px; }
.track { display: flex; flex-direction: column; gap: 8px; }
.track audio { width: 100%; }
.track .row button { flex: 1; }
.mix { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.mix a { color: var(--accent); text-decoration: none; }
#toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  background: var(--card); color: var(--fg); padding: 10px 16px;
  border-radius: 10px; opacity: 0; transition: opacity .3s; pointer-events: none;
  max-width: 90%; box-shadow: 0 4px 14px rgba(0,0,0,.4);
}
#toast.show { opacity: 1; }
.empty { color: var(--hint); text-align: center; padding: 24px 0; }
