:root {
  --bg: #14131a;
  --surface: #1f1d28;
  --line: #2c2a37;
  --text: #f3f1f7;
  --muted: #9d99ab;
  --accent: #f2a93b;
  --warn: #5a2a1e;
  --mini-h: 68px;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 16px/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
  padding-bottom: calc(var(--mini-h) + env(safe-area-inset-bottom) + 8px);
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
svg { display: block; width: 24px; height: 24px; }

.top {
  position: sticky; top: 0; z-index: 5;
  background: var(--bg);
  padding: calc(env(safe-area-inset-top) + 8px) 16px 10px;
  border-bottom: 1px solid var(--line);
}
.top-row { display: flex; align-items: center; gap: 4px; min-height: 44px; }
h1 { margin: 0; font-size: 24px; font-weight: 700; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#search {
  width: 100%; height: 42px; margin-top: 6px; padding: 0 14px;
  font-size: 16px; /* меньше 16px iOS зумит страницу при фокусе */
  color: var(--text); background: var(--surface);
  border: 1px solid transparent; border-radius: 12px; outline: none;
  -webkit-appearance: none; appearance: none;
}
#search:focus { border-color: var(--accent); }
#search::placeholder { color: var(--muted); }

.icon-btn {
  width: 44px; height: 44px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
}
.icon-btn:active { background: var(--surface); }
.icon-btn[aria-pressed="true"] { color: var(--accent); }
.icon-btn-spacer { width: 44px; height: 44px; flex: none; }
#back { margin-left: -12px; }

.banner { padding: 12px 16px; background: var(--warn); line-height: 1.35; font-size: 15px; }
.banner strong { display: block; margin-bottom: 2px; }

.list { display: block; }
.row {
  display: flex; align-items: center; width: 100%; min-height: 60px;
  border-bottom: 1px solid var(--line);
  content-visibility: auto; contain-intrinsic-size: auto 60px;
}
.row-main {
  flex: 1; min-width: 0; min-height: 60px; padding: 9px 4px 9px 16px;
  display: flex; flex-direction: column; justify-content: center; text-align: left;
}
.row-main:active { background: var(--surface); }
.row.current .line-1 { color: var(--accent); }
.line-1, .line-2 { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.line-2 { margin-top: 2px; font-size: 14px; color: var(--muted); }
.row-side { flex: none; padding-right: 16px; font-size: 14px; color: var(--muted); }
.row .icon-btn { margin-right: 4px; color: var(--muted); }
.action-row { display: flex; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.pill {
  flex: 1; min-height: 44px; padding: 0 10px; border-radius: 12px;
  background: var(--surface); font-weight: 600;
}
.pill:active { background: var(--line); }
.empty { padding: 40px 24px; text-align: center; color: var(--muted); line-height: 1.4; }

.mini {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; align-items: center;
  padding: 0 6px env(safe-area-inset-bottom) 0;
  min-height: calc(var(--mini-h) + env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid var(--line);
}
.mini-progress { position: absolute; top: -1px; left: 0; height: 2px; width: 0; background: var(--accent); }
.mini-open { flex: 1; min-width: 0; height: var(--mini-h); padding: 0 8px 0 16px; text-align: left; }

.sheet {
  position: fixed; inset: 0; z-index: 20; background: var(--bg);
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding-top: env(safe-area-inset-top);
  padding-bottom: calc(env(safe-area-inset-bottom) + 16px);
}
.sheet-head { display: flex; align-items: center; padding: 6px 8px; }
.sheet-folder { flex: 1; min-width: 0; text-align: center; color: var(--muted); font-size: 14px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sheet-body { display: flex; flex-direction: column; }
.cover {
  display: block; width: min(62vw, 38vh, 340px); height: auto; aspect-ratio: 1;
  margin: 4px auto 20px; border-radius: 18px;
}
.now { padding: 0 24px; text-align: center; }
.now-title { font-size: 20px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.now-artist { margin-top: 4px; color: var(--muted); overflow-wrap: anywhere; }
.seek { display: block; width: calc(100% - 48px); margin: 18px 24px 2px; height: 32px; accent-color: var(--accent); background: none; }
.times { display: flex; justify-content: space-between; padding: 0 24px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.controls { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px 14px; }
.icon-btn.big { width: 56px; height: 56px; }
.icon-btn.big svg { width: 34px; height: 34px; }
.play-btn {
  width: 72px; height: 72px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: #17130b;
}
.play-btn:active { filter: brightness(.9); }
.play-btn svg { width: 36px; height: 36px; }
.queue-title { margin: 8px 0 0; padding: 10px 16px; font-size: 15px; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--mini-h) + env(safe-area-inset-bottom) + 12px);
  transform: translateX(-50%); z-index: 30; max-width: 88vw;
  padding: 10px 16px; border-radius: 12px; background: #35323f; font-size: 14px;
}
