:root {
	--bg: #000;
	--fg: #fff;
	--fg-2: #98989d;
	--fg-3: #6c6c70; /* was #545458 — bumped to Apple tertiaryLabel for WCAG-AA legibility of dim secondary text (durations, section labels) */
	--line: #1c1c1e;
	--surface: #0a0a0a;
	--surface-2: #1c1c1e;
	--surface-3: #2c2c2e;
	--accent: #fff;
	--green: #30d158;
	--red: #ff453a;
	--ytm: #ff5757;
	--bc: #629aa9;
	--radius: 12px;
	--safe-bottom: env(safe-area-inset-bottom, 0px);
	--safe-top: env(safe-area-inset-top, 0px); /* overridden by JS with tg.contentSafeAreaInset */
	--safe-left: 0px;
	--safe-right: 0px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; }
input, [contenteditable] { -webkit-user-select: text; user-select: text; }

html, body {
	margin: 0; padding: 0;
	height: 100%; width: 100%;
	background: var(--bg);
	color: var(--fg);
	font: 15px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, sans-serif;
	-webkit-font-smoothing: antialiased;
	overflow: hidden;
	overscroll-behavior: none;
}

body { padding-bottom: var(--safe-bottom); }

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input { font: inherit; color: inherit; background: none; border: 0; outline: none; }
input::placeholder { color: var(--fg-3); }
input::-webkit-search-cancel-button { display: none; }
ul { list-style: none; margin: 0; padding: 0; }
svg { display: block; width: 100%; height: 100%; }

#flow-bg {
	position: fixed;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	opacity: 1;
	transition: opacity .5s ease;
}
/* No WebGL2: the void stays, just without the field. */
html.no-gl #flow-bg { display: none; }

#app { display: flex; flex-direction: column; height: 100%; position: relative; z-index: 1; }

/* === TOP TABS === */

#topbar {
	flex-shrink: 0;
	padding: 8px 12px 8px;
	padding-top: calc(12px + var(--safe-top));
	padding-left: calc(12px + var(--safe-left));
	padding-right: calc(12px + var(--safe-right));
	background: var(--bg);
	z-index: 5;
}

.tabs {
	position: relative;
	display: flex; gap: 0;
	background: var(--surface-2);
	border-radius: 10px;
	padding: 3px;
}

.tab {
	flex: 1;
	padding: 8px 10px;
	font-size: 13px;
	font-weight: 600;
	color: var(--fg-2);
	border-radius: 8px;
	transition: color .25s ease;
	z-index: 1;
	position: relative;
}

.tab.active { color: var(--fg); }

.tab-indicator {
	position: absolute;
	top: 3px; bottom: 3px;
	left: 3px;
	width: calc((100% - 6px) / 3);
	background: var(--bg);
	border-radius: 8px;
	transition: transform .25s cubic-bezier(.4,.0,.2,1);
	transform: translateX(0);
	box-shadow: 0 2px 8px rgba(0,0,0,.4);
}

.tab[data-tab="history"].active ~ .tab-indicator { transform: translateX(100%); }
.tab[data-tab="playlists"].active ~ .tab-indicator { transform: translateX(200%); }

/* === VIEWS === */

.view { display: none; flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.view.active { display: block; animation: fadeIn .2s ease; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* === HERO / SEARCH === */

.hero {
	padding: 20px 20px 12px;
	text-align: center;
}

.hero .title {
	font-size: 32px;
	font-weight: 700;
	letter-spacing: -0.8px;
	margin-bottom: 4px;
}

.hero .subtitle {
	font-size: 10.5px;
	color: var(--fg-3);
	letter-spacing: 1.4px;
	text-transform: uppercase;
	margin-bottom: 22px;
	font-weight: 600;
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}
.hero .subtitle .src-tag {
	white-space: nowrap;
	transition: color .15s;
}
.hero .subtitle .src-tag:hover {
	color: var(--fg-2);
}
.hero .subtitle .src-sep {
	width: 3px;
	height: 3px;
	border-radius: 50%;
	background: var(--fg-3);
	opacity: .55;
	display: inline-block;
}

.search-wrap {
	display: flex;
	align-items: center;
	background: var(--surface-2);
	border-radius: 12px;
	padding: 0 12px;
	height: 44px;
	gap: 8px;
	transition: background .15s, box-shadow .15s;
}

.search-wrap:focus-within {
	background: var(--surface-3);
	box-shadow: 0 0 0 1px rgba(255,255,255,.08);
}

.search-icon { width: 18px; height: 18px; color: var(--fg-3); flex-shrink: 0; display: inline-flex; }

#q {
	flex: 1;
	height: 100%;
	font-size: 15px;
	-webkit-appearance: none;
}

.clear-btn {
	width: 18px; height: 18px;
	flex-shrink: 0;
	color: var(--fg-3);
}
.clear-btn[hidden] { display: none; }

/* === SEARCH SUGGESTIONS === */

.suggest {
	margin: 6px 0 0;
	padding: 4px 0;
	background: var(--surface-2);
	border-radius: 12px;
	overflow: hidden;
	animation: suggIn .12s ease;
	text-align: left;
}
.suggest[hidden] { display: none; }
.suggest li {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 14px;
	font-size: 14px;
	color: var(--fg);
	cursor: pointer;
	transition: background .1s;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.suggest li:active { background: var(--surface-3); }
.suggest li .sg-ic {
	width: 14px; height: 14px;
	color: var(--fg-3);
	flex-shrink: 0;
	display: inline-flex;
}
.suggest li .sg-tx {
	flex: 1;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
@keyframes suggIn {
	from { opacity: 0; transform: translateY(-4px); }
	to { opacity: 1; transform: translateY(0); }
}



/* === SECTION HEADERS === */

.section, .section-head {
	padding: 20px 16px 8px;
	display: flex; align-items: center; justify-content: space-between;
	pointer-events: none;
}

.section-title {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 1.2px;
	text-transform: uppercase;
	color: var(--fg-3);
}

.section.sc .section-title { color: var(--fg-3); }
.section.ytm .section-title { color: var(--ytm); }
.section.bandcamp .section-title { color: var(--bc); }

.section .hint {
	font-size: 10px;
	color: var(--fg-3);
	font-weight: 500;
}

/* === LIST / ROW === */

.list { padding: 0 0 120px; }

.row {
	display: flex; align-items: center; gap: 12px;
	padding: 8px 16px;
	min-height: 64px;
	transition: background .12s ease;
	cursor: pointer;
	contain: layout style;
}

.row:active { background: var(--surface-2); }
.row.playing { background: var(--surface); }

.row .art {
	width: 50px; height: 50px;
	flex-shrink: 0;
	border-radius: 8px;
	background: var(--surface-2);
	overflow: hidden;
	position: relative;
}

.row .art img {
	width: 100%; height: 100%; object-fit: cover; display: block;
}
.row .art.pl-cover {
	background: linear-gradient(135deg, #2a1f3d, #1a2a3d);
}

.row .eq {
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,.55);
	display: none;
	align-items: flex-end;
	justify-content: center;
	gap: 3px;
	padding: 0 12px 10px;
	pointer-events: none;
}
.row.playing .eq { display: flex; }
.row .eq span {
	width: 3px;
	height: 8px;
	background: var(--fg);
	border-radius: 1.5px;
	animation: eqWave 1s ease-in-out infinite;
	transform-origin: bottom;
}
.row .eq span:nth-child(1) { animation-delay: 0s; }
.row .eq span:nth-child(2) { animation-delay: .2s; }
.row .eq span:nth-child(3) { animation-delay: .4s; }
.row.paused .eq span { animation-play-state: paused; }

@keyframes eqWave {
	0%, 100% { height: 4px; }
	50% { height: 22px; }
}

.row .info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.row .info .t { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 15px; }
.row .info .a { color: var(--fg-2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .info .dur { color: var(--fg-3); margin-left: 8px; font-size: 12px; }
.row .info .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-left: 8px; vertical-align: middle; }
.row .info .dot.cached { background: var(--green); }

.row .ops { display: flex; gap: 2px; flex-shrink: 0; align-items: center; }

/* === ICON BUTTONS === */

.icon-btn {
	width: 44px; height: 44px;
	display: inline-flex; align-items: center; justify-content: center;
	border-radius: 50%;
	color: var(--fg-2);
	transition: background .12s, color .12s, transform .12s;
}

.icon-btn svg { width: 19px; height: 19px; }

.icon-btn:active { background: var(--surface-2); color: var(--fg); transform: scale(0.92); }
.icon-btn.playing { color: var(--fg); background: var(--surface-2); }
.icon-btn.loading { color: var(--fg-2); }
.icon-btn.add-q { width: 36px; height: 36px; }
.icon-btn.add-q svg { width: 15px; height: 15px; }
.icon-btn.add-pl { width: 36px; height: 36px; }
.icon-btn.add-pl svg { width: 15px; height: 15px; }
.icon-btn.like-btn { width: 44px; height: 44px; }       /* match play/send so the row stays even */
.icon-btn.like-btn svg { width: 18px; height: 18px; }
.icon-btn.like-btn.liked { color: var(--red); }

/* === EMPTY STATES === */

.empty {
	padding: 80px 20px;
	text-align: center;
	color: var(--fg-2);
	font-size: 14px;
	display: flex; flex-direction: column; align-items: center; gap: 14px;
}

.empty.hidden { display: none; }

.empty-illu {
	width: 64px; height: 64px;
	border-radius: 16px;
	background: var(--surface-2);
	background-image: radial-gradient(circle at center, var(--surface-3) 30%, transparent 31%);
}

/* === EMPTY/PRIMARY BUTTONS === */

.empty-btn {
	width: 100%;
	height: 56px;
	border: 1px dashed var(--fg-3);
	border-radius: 12px;
	display: flex; align-items: center; justify-content: center; gap: 8px;
	color: var(--fg-2);
	font-weight: 500;
	font-size: 14px;
	transition: border-color .15s, color .15s, background .12s;
}

.empty-btn:active { background: var(--surface-2); color: var(--fg); border-color: var(--fg-2); }
.empty-btn-icon { width: 16px; height: 16px; display: inline-flex; }
.empty-btn-icon svg { width: 16px; height: 16px; }

.pl-actions { padding: 12px 16px 8px; }

/* === MINI PLAYER === */

.mini-player {
	position: fixed;
	bottom: 0; left: 0; right: 0;
	z-index: 8;
	background: rgba(18,18,18,.92);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	padding-bottom: var(--safe-bottom);
	animation: miniIn .2s ease;
}
.mini-player[hidden] { display: none; }

@keyframes miniIn {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: translateY(0); }
}

.mp-progress {
	height: 2px;
	background: var(--surface-3);
}
.mp-fill {
	height: 100%;
	width: 0;
	background: var(--fg);
	transition: width .15s linear;
	will-change: width;
}

.mp-body {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px 12px 8px 12px;
	min-height: 52px;
	cursor: pointer;
}

.mp-art {
	width: 40px; height: 40px;
	border-radius: 6px;
	object-fit: cover;
	background: var(--surface-3);
	flex-shrink: 0;
}

.mp-info { flex: 1; min-width: 0; }

.mp-title {
	font-size: 14px;
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.mp-artist {
	font-size: 12px;
	color: var(--fg-2);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	margin-top: 1px;
}

.mp-btn {
	width: 44px; height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var(--fg);
	flex-shrink: 0;
	border-radius: 50%;
	transition: background .12s;
}
.mp-btn:active { background: var(--surface-3); }
.mp-btn svg { width: 20px; height: 20px; }

body.has-mini .admin-btn { bottom: calc(72px + var(--safe-bottom)); }
body.has-mini .info-btn { bottom: calc(72px + var(--safe-bottom)); }
body.has-mini #toast { bottom: calc(76px + var(--safe-bottom)); }
body.has-mini #artist-sections { padding-bottom: 72px; }

/* === PLAYER === */

#player {
	position: fixed;
	inset: 0;
	z-index: 10;
	background: #0a0a0a;
	padding: 20px 20px;
	padding-top: calc(20px + var(--safe-top));
	padding-bottom: calc(20px + var(--safe-bottom));
	display: none;
	flex-direction: column;
	overflow: hidden;
}

#player.open { display: flex; animation: playerIn .3s cubic-bezier(.2,.8,.2,1); }
#player.closing { display: flex; animation: playerOut .25s cubic-bezier(.4,0,1,1) forwards; }

@keyframes playerIn {
	from { opacity: 0; transform: translateY(40px) scale(0.97); }
	to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes playerOut {
	from { opacity: 1; transform: translateY(0); }
	to { opacity: 0; transform: translateY(60px); }
}

.p-bg-art {
	position: absolute;
	inset: -30%;
	z-index: 0;
	pointer-events: none;
}
.p-bg-art img {
	width: 100%; height: 100%;
	object-fit: cover;
	filter: blur(80px) brightness(0.35) saturate(1.6);
	transform: scale(1.1);
	transition: opacity .6s ease;
}
.p-bg-overlay {
	position: absolute;
	inset: 0;
	z-index: 0;
	background: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.5) 50%, rgba(0,0,0,0.7) 100%);
	pointer-events: none;
}

.p-close-btn {
	position: absolute;
	top: calc(8px + var(--safe-top));
	left: 50%;
	transform: translateX(-50%);
	width: 44px; height: 44px;
	color: rgba(255,255,255,.55);
	z-index: 2;
}
.p-close-btn svg { width: 24px; height: 24px; }

.p-art-wrap {
	display: flex; justify-content: center; align-items: center;
	margin: auto auto 28px;
	z-index: 1;
}

.p-art {
	width: min(78vw, 340px);
	aspect-ratio: 1;
	border-radius: 14px;
	overflow: hidden;
	background: var(--surface-2);
	box-shadow:
		0 20px 60px rgba(0,0,0,.5),
		0 8px 20px rgba(0,0,0,.4);
	transition: transform .35s cubic-bezier(.2,.7,.2,1);
}

#player .p-art img {
	width: 100%; height: 100%; object-fit: cover; display: block;
	transition: opacity .3s ease, transform .35s cubic-bezier(.2,.7,.2,1);
}
.p-art.swapping img { opacity: 0.3; transform: scale(0.96); }
.p-art.playing { animation: artBreath 8s ease-in-out infinite; }
@keyframes artBreath {
	0%, 100% { transform: scale(1); }
	50% { transform: scale(1.012); }
}

.p-meta {
	text-align: center;
	margin-bottom: 24px;
	padding: 0 20px;
	z-index: 1;
}
.p-meta .t, .p-meta .a {
	transition: opacity .25s ease, transform .3s cubic-bezier(.2,.7,.2,1);
}
.p-meta.swapping .t, .p-meta.swapping .a {
	opacity: 0.3;
	transform: translateY(4px);
}
.p-meta .t { font-size: 20px; font-weight: 700; letter-spacing: -0.4px; line-height: 1.25; }
.p-meta .a { color: rgba(255,255,255,.55); margin-top: 6px; font-size: 14px; }

.p-prog {
	padding: 0 4px;
	z-index: 1;
}
.p-prog .bar {
	height: 3px;
	background: rgba(255,255,255,.15);
	border-radius: 2px;
	overflow: visible;
	cursor: pointer;
	position: relative;
	transition: height .15s;
}
.p-prog .bar::before {
	content: '';
	position: absolute;
	top: -18px; bottom: -18px;
	left: 0; right: 0;
}
.p-prog .bar.dragging,
.p-prog .bar:active { height: 5px; }
.p-prog .fill {
	height: 100%;
	width: 0;
	background: rgba(255,255,255,.85);
	border-radius: 2px;
	transition: width .15s linear;
	will-change: width;
}
.p-prog .bar.loading::before {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.18) 50%, transparent 100%);
	background-size: 50% 100%;
	background-repeat: no-repeat;
	animation: barShimmer 1.1s linear infinite;
}
@keyframes barShimmer {
	0% { background-position: -50% 0; }
	100% { background-position: 150% 0; }
}
.p-prog .thumb {
	position: absolute;
	top: 50%;
	width: 14px; height: 14px;
	border-radius: 50%;
	background: #fff;
	transform: translate(-50%, -50%);
	left: 0;
	opacity: 0;
	transition: opacity .15s;
	box-shadow: 0 0 10px rgba(255,255,255,.25);
}
.p-prog .bar:active .thumb,
.p-prog .bar.dragging .thumb { opacity: 1; }
.p-prog .times {
	display: flex; justify-content: space-between;
	margin-top: 8px;
	font-size: 11px;
	font-feature-settings: "tnum";
	color: rgba(255,255,255,.4);
}

.p-controls {
	display: flex; justify-content: center; align-items: center; gap: 36px;
	margin-top: 28px;
	z-index: 1;
}

.p-controls .ctrl {
	width: 52px; height: 52px;
	display: inline-flex; align-items: center; justify-content: center;
	color: rgba(255,255,255,.85);
	transition: transform .15s, opacity .15s;
}
.p-controls .ctrl svg { width: 26px; height: 26px; }
.p-controls .ctrl:active { transform: scale(0.88); opacity: .6; }
.p-controls .ctrl.disabled { opacity: .2; pointer-events: none; }

.p-controls .ctrl.big {
	width: 64px; height: 64px;
	background: rgba(255,255,255,.9);
	color: #000;
	border-radius: 50%;
	box-shadow: 0 4px 20px rgba(255,255,255,.08);
	transition: transform .15s, background .15s;
}
.p-controls .ctrl.big:active { background: rgba(255,255,255,.7); transform: scale(0.92); }
.p-controls .ctrl.big svg { width: 26px; height: 26px; }

.p-actions {
	display: flex; justify-content: center; align-items: center;
	gap: 16px;
	margin-top: auto;
	padding-top: 20px;
	z-index: 1;
}
.p-send-btn {
	display: inline-flex; align-items: center; gap: 7px;
	height: 40px;
	padding: 0 24px;
	border-radius: 20px;
	background: rgba(255,255,255,.12);
	color: rgba(255,255,255,.75);
	font-size: 13px;
	font-weight: 600;
	transition: background .15s, transform .12s, color .15s;
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
}
.p-send-btn:active { background: rgba(255,255,255,.2); color: #fff; transform: scale(0.96); }
.p-send-btn .bicon { width: 14px; height: 14px; display: inline-flex; }
.p-send-btn .bicon svg { width: 14px; height: 14px; }

/* === BUTTONS === */

.btn {
	flex: 1;
	height: 48px;
	border-radius: 12px;
	background: var(--surface-2);
	font-size: 15px;
	font-weight: 500;
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	transition: opacity .12s, transform .12s, background .12s;
}

.btn:active { opacity: .8; transform: scale(0.98); }
.btn.primary { background: var(--fg); color: var(--bg); }
.btn .bicon { width: 16px; height: 16px; display: inline-flex; }
.btn .bicon svg { width: 16px; height: 16px; }

/* === TOAST === */

#toast {
	position: fixed;
	bottom: calc(20px + var(--safe-bottom));
	left: 50%;
	transform: translateX(-50%) translateY(20px);
	background: rgba(28, 28, 30, .95);
	backdrop-filter: blur(20px);
	color: var(--fg);
	padding: 12px 18px;
	border-radius: 24px;
	font-size: 13.5px;
	font-weight: 500;
	opacity: 0;
	pointer-events: none;
	transition: opacity .25s, transform .25s;
	z-index: 30;
	white-space: nowrap;
	max-width: calc(100vw - 40px);
	overflow: hidden; text-overflow: ellipsis;
	box-shadow: 0 8px 24px rgba(0,0,0,.5);
}

#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* === COMING SOON === */

.soon {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 60vh;
}
.soon-text {
	font-size: 16px;
	font-weight: 500;
	color: var(--fg-3);
	letter-spacing: 1.5px;
	text-transform: uppercase;
}

/* === PROMPT MODAL === */

.prompt-modal {
	position: fixed; inset: 0;
	z-index: 35;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 20px;
}
.prompt-modal.open { display: flex; }
.prompt-bg {
	position: absolute; inset: 0;
	background: rgba(0,0,0,.7);
	animation: bgFade .15s ease;
}
.prompt-card {
	position: relative;
	background: var(--surface-2);
	border-radius: 14px;
	padding: 20px;
	width: 100%;
	max-width: 320px;
	animation: promptIn .22s cubic-bezier(.2,.7,.2,1);
}
.prompt-title {
	font-size: 16px;
	font-weight: 600;
	text-align: center;
	margin-bottom: 14px;
}
.prompt-input {
	width: 100%;
	height: 44px;
	background: var(--surface);
	border-radius: 10px;
	padding: 0 14px;
	font-size: 15px;
	color: var(--fg);
	border: 1px solid transparent;
	transition: border-color .15s;
}
.prompt-input:focus { border-color: rgba(255,255,255,.15); }
.prompt-actions {
	display: flex;
	gap: 8px;
	margin-top: 14px;
}
.prompt-btn {
	flex: 1;
	height: 44px;
	border-radius: 10px;
	background: var(--surface);
	font-size: 15px;
	font-weight: 500;
	transition: opacity .12s, transform .12s;
}
.prompt-btn:active { opacity: .8; transform: scale(0.97); }
.prompt-btn.primary { background: var(--fg); color: var(--bg); }

@keyframes promptIn { from { opacity: 0; transform: scale(.95); } to { opacity: 1; transform: scale(1); } }

@keyframes bgFade { from { opacity: 0; } to { opacity: 1; } }

/* === SKELETON === */

.skeleton {
	background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%);
	background-size: 200% 100%;
	animation: sk 1.4s ease-in-out infinite;
	border-radius: 4px;
}
.sk-line { height: 12px; }
.w60 { width: 60%; }
.w40 { width: 40%; }
.mt6 { margin-top: 6px; }

@keyframes sk { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin .7s linear infinite; }

/* === ALBUM VIEW === */

.album-view { padding-bottom: 24px; }

.album-topbar {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 12px;
	padding-top: calc(8px + var(--safe-top));
	position: sticky;
	top: 0;
	background: linear-gradient(to bottom, rgba(0,0,0,0.95) 60%, rgba(0,0,0,0));
	z-index: 5;
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
}

.album-topbar .back-btn {
	width: 32px; height: 32px;
}

.album-topbar-title {
	font-size: 14px;
	font-weight: 600;
	color: var(--fg-2);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.album-hero {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 8px 20px 18px;
	gap: 16px;
}

.album-art {
	width: min(72vw, 280px);
	aspect-ratio: 1 / 1;
	border-radius: 12px;
	overflow: hidden;
	background: var(--surface-2);
	box-shadow: 0 12px 40px rgba(0,0,0,.6);
}
.album-art img { width: 100%; height: 100%; object-fit: cover; display: block; }

.album-meta { text-align: center; }
.album-title {
	font-size: 22px;
	font-weight: 700;
	letter-spacing: -0.4px;
	line-height: 1.2;
	margin-bottom: 4px;
}
.album-artist {
	font-size: 15px;
	color: var(--fg-2);
	font-weight: 500;
	margin-bottom: 6px;
}
.album-info {
	font-size: 11px;
	color: var(--fg-3);
	letter-spacing: 0.8px;
	text-transform: uppercase;
	font-weight: 600;
}

.album-actions {
	display: flex;
	gap: 8px;
	width: 100%;
	max-width: 380px;
	flex-wrap: wrap;
}
.album-actions .btn {
	flex: 1 1 100px;
	min-width: 0;
	height: 44px;
	font-size: 13px;
	font-weight: 600;
	white-space: nowrap;
}

.album-progress {
	width: 100%;
	max-width: 380px;
}
.album-progress.hidden { display: none; }
.album-progress-text {
	font-size: 12px;
	color: var(--fg-2);
	margin-bottom: 6px;
	text-align: center;
}
.album-progress-bar {
	height: 3px;
	background: var(--surface-2);
	border-radius: 2px;
	overflow: hidden;
}
.album-progress-fill {
	height: 100%;
	background: var(--fg);
	width: 0;
	transition: width .25s ease;
}

#view-album .list .row { padding-left: 16px; padding-right: 16px; }

/* === ARTIST VIEW === */

.artist-view { padding-bottom: 24px; }

.artist-hero {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 8px 20px 18px;
	gap: 12px;
}

.artist-avatar {
	width: min(48vw, 180px);
	aspect-ratio: 1 / 1;
	border-radius: 50%;
	overflow: hidden;
	background: var(--surface-2);
	box-shadow: 0 12px 40px rgba(0,0,0,.6);
}
.artist-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.artist-name {
	font-size: 22px;
	font-weight: 700;
	letter-spacing: -0.4px;
	line-height: 1.2;
	text-align: center;
}
.artist-meta {
	font-size: 11px;
	color: var(--fg-3);
	letter-spacing: 0.8px;
	text-transform: uppercase;
	font-weight: 600;
	text-align: center;
}

#artist-sections { padding-bottom: 24px; }

.art-section { margin-top: 16px; }

.art-section-head {
	display: flex;
	align-items: baseline;
	gap: 10px;
	padding: 20px 16px 6px;
}
.art-section-head .src-name {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 1.2px;
	text-transform: uppercase;
	color: var(--fg-3);
}
.art-section.ytm .art-section-head .src-name { color: var(--ytm); }
.art-section.sc  .art-section-head .src-name { color: var(--fg-3); }
.art-section .src-stats {
	font-size: 11px;
	color: var(--fg-3);
	font-weight: 500;
}

.art-subhead {
	font-size: 10.5px;
	font-weight: 600;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: var(--fg-3);
	padding: 16px 16px 6px;
}

.load-more {
	display: block;
	width: calc(100% - 32px);
	margin: 8px 16px 4px;
	height: 40px;
	background: var(--surface-2);
	color: var(--fg-2);
	border-radius: 10px;
	font-size: 13px;
	font-weight: 600;
	transition: background .12s, color .12s, opacity .12s;
}
.load-more:active { background: var(--surface-3); color: var(--fg); }
.load-more:disabled { opacity: .55; }

/* Внутри артист-секций .list не должен раздувать паддинг до 120px
   (это для скролл-зоны вкладок), иначе зияет дыра до load-more */
.art-section .list { padding-bottom: 0; }
.art-section + .art-section { margin-top: 4px; }

/* Clickable artist name in track rows — high-contrast so it reads as a link */
.art-link {
	display: inline;
	font: inherit;
	font-weight: 600;
	color: var(--fg);
	background: none;
	border: 0;
	padding: 0;
	margin: 0;
	cursor: pointer;
	-webkit-user-select: none;
	text-align: left;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	vertical-align: bottom;
	text-decoration: underline;
	text-decoration-color: var(--fg-2);
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
	transition: color .12s, text-decoration-color .12s;
}
.art-link:active {
	color: var(--fg-2);
	text-decoration-color: var(--fg-3);
}

/* === ADMIN === */

.admin-btn {
	position: fixed;
	right: 14px;
	bottom: calc(14px + var(--safe-bottom));
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--surface-2);
	color: var(--fg-3);
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.5px;
	z-index: 9;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	opacity: 0.55;
	transition: opacity .15s, background .15s;
}
.admin-btn[hidden] { display: none; }
.admin-btn:active { opacity: 1; background: var(--surface-3); }
.admin-btn::before { content: "·"; font-size: 22px; line-height: 1; }

/* Info / onboarding button — bottom-left, visible to everyone */
.info-btn {
	position: fixed;
	left: calc(14px + var(--safe-left));
	bottom: calc(14px + var(--safe-bottom));
	z-index: 15;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	border: 1px solid var(--line);
	background: var(--surface-2);
	color: var(--fg-2);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 15px;
	font-weight: 600;
	font-style: italic;
	font-family: Georgia, "Times New Roman", serif;
	cursor: pointer;
}
.info-btn::before { content: "i"; }
.info-btn:active { background: var(--surface-3); }
.info-btn.has-news::after {
	content: "";
	position: absolute;
	top: -1px; right: -1px;
	width: 9px; height: 9px;
	border-radius: 50%;
	background: #ff3b30;
	border: 2px solid var(--bg);
}

.info-top-spacer { width: 44px; flex-shrink: 0; }
.info-tabs {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 10px 16px 0;
	position: relative;
}
.info-tab {
	background: none;
	border: none;
	color: var(--fg-3);
	font-size: 13px;
	font-weight: 600;
	padding: 6px 12px;
	border-radius: 18px;
	cursor: pointer;
}
.info-tab.active { color: var(--fg); background: var(--surface-2); }
.info-tab-dot {
	width: 7px; height: 7px; border-radius: 50%;
	background: #ff3b30; margin-left: 2px;
}
.info-pane { display: none; }
.info-pane.active { display: block; animation: fadeIn .15s ease; }
.info-block { margin-bottom: 22px; }
.info-block-h {
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: 1.2px;
	text-transform: uppercase;
	color: var(--fg-3);
	margin: 0 0 10px 2px;
}
.info-line {
	display: flex;
	gap: 9px;
	font-size: 14px;
	line-height: 1.45;
	color: var(--fg-2);
	margin-bottom: 9px;
}
.info-line::before {
	content: "";
	flex-shrink: 0;
	width: 5px; height: 5px;
	border-radius: 50%;
	background: var(--fg-3);
	margin-top: 8px;
}
.info-news-entry { margin-bottom: 22px; }
.info-news-date {
	font-size: 12px;
	font-weight: 700;
	color: var(--fg);
	margin-bottom: 8px;
}

.admin-overlay {
	position: fixed;
	inset: 0;
	z-index: 25;
	background: var(--bg);
	display: none;
	flex-direction: column;
	overflow: hidden;
}
.admin-overlay[hidden] { display: none; }
.admin-overlay.open { display: flex; animation: fadeIn .15s ease; }

.admin-top {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 12px;
	padding-top: calc(8px + var(--safe-top));
	border-bottom: 1px solid var(--line);
}
.admin-top-title {
	flex: 1;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 1.2px;
	text-transform: uppercase;
	color: var(--fg-2);
}

.admin-body {
	flex: 1;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	padding: 16px 16px calc(40px + var(--safe-bottom));
}

.admin-loading {
	padding: 60px 0;
	text-align: center;
	color: var(--fg-3);
	font-size: 13px;
}

.admin-section { margin-bottom: 24px; }
.admin-section-h {
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: 1.2px;
	text-transform: uppercase;
	color: var(--fg-3);
	margin: 0 0 10px 4px;
}

.adm-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 8px;
}
.adm-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.adm-card {
	background: var(--surface-2);
	border-radius: 10px;
	padding: 10px 8px;
	text-align: center;
}
.adm-card .v {
	font-size: 19px;
	font-weight: 700;
	letter-spacing: -0.3px;
	font-feature-settings: "tnum";
	color: var(--fg);
}
.adm-card .l {
	font-size: 10px;
	color: var(--fg-3);
	margin-top: 4px;
	letter-spacing: 0.5px;
	text-transform: uppercase;
}

.adm-bars {
	display: flex;
	align-items: flex-end;
	gap: 6px;
	height: 60px;
	padding: 0 4px;
}
.adm-bar-col {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	min-width: 0;
}
.adm-bar {
	width: 100%;
	background: var(--fg);
	border-radius: 3px 3px 0 0;
	min-height: 2px;
	transition: height .25s ease;
}
.adm-bar-label {
	font-size: 9.5px;
	color: var(--fg-3);
	font-feature-settings: "tnum";
}
.adm-bar-val {
	font-size: 10px;
	color: var(--fg-2);
	font-feature-settings: "tnum";
}

.adm-list {
	background: var(--surface-2);
	border-radius: 10px;
	padding: 4px 0;
	margin: 0;
}
.adm-list li {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 12px;
	font-size: 13px;
	border-bottom: 1px solid var(--surface);
	min-height: 38px;
}
.adm-list li:last-child { border-bottom: none; }
.adm-list .adm-rank {
	width: 18px;
	color: var(--fg-3);
	font-size: 11px;
	font-weight: 600;
	font-feature-settings: "tnum";
	flex-shrink: 0;
	text-align: right;
}
.adm-list .adm-main {
	flex: 1;
	min-width: 0;
	overflow: hidden;
}
.adm-list .adm-main .t {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: var(--fg);
}
.adm-list .adm-main .s {
	font-size: 11px;
	color: var(--fg-3);
	margin-top: 2px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.adm-list .adm-n {
	font-size: 12px;
	color: var(--fg-2);
	font-feature-settings: "tnum";
	font-weight: 600;
	flex-shrink: 0;
}

.adm-src {
	display: inline-block;
	font-size: 9px;
	letter-spacing: 0.6px;
	text-transform: uppercase;
	color: var(--fg-3);
	padding: 1px 5px;
	border-radius: 3px;
	background: var(--surface);
	margin-left: 6px;
	vertical-align: middle;
	font-weight: 600;
}
.adm-src.ytm { color: var(--ytm); }
.adm-src.bandcamp { color: var(--bc); }

.adm-recent li .adm-time {
	font-size: 10.5px;
	color: var(--fg-3);
	font-feature-settings: "tnum";
	flex-shrink: 0;
}

/* === ALBUM CARDS (in search results) === */

.albums-section { padding: 20px 16px 8px; }

.albums-row {
	list-style: none;
	padding: 0 0 8px;
	margin: 0;
}

.albums-scroll {
	display: flex;
	gap: 12px;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	padding: 4px 16px 12px;
	scrollbar-width: none;
}
.albums-scroll::-webkit-scrollbar { display: none; }

.album-card {
	flex: 0 0 auto;
	width: 130px;
	background: transparent;
	border: none;
	padding: 0;
	text-align: left;
	cursor: pointer;
	display: flex;
	flex-direction: column;
	gap: 6px;
	color: var(--fg);
}
.album-card:active { transform: scale(0.96); transition: transform .1s; }

.album-card-art {
	width: 130px;
	height: 130px;
	border-radius: 8px;
	overflow: hidden;
	background: var(--surface-2);
}
.album-card-art img { width: 100%; height: 100%; object-fit: cover; display: block; }

.album-card-name {
	font-size: 13px;
	font-weight: 600;
	line-height: 1.25;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}
.album-card-meta {
	font-size: 11px;
	color: var(--fg-3);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* track card */
.track-card-view.active { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.tc-bg {
	position: fixed; inset: 0; z-index: 0; overflow: hidden;
}
.tc-bg img {
	width: 100%; height: 100%; object-fit: cover;
	filter: blur(80px) saturate(1.4) brightness(.35);
	transform: scale(1.3);
}
.tc-bg-overlay {
	position: absolute; inset: 0;
	background: linear-gradient(to bottom, rgba(0,0,0,.5), rgba(0,0,0,.7));
}
.tc-hero {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 24px 20px;
	gap: 16px;
	width: 100%;
	z-index: 1;
	position: relative;
}
.tc-art {
	width: min(78vw, 320px);
	aspect-ratio: 1 / 1;
	border-radius: 14px;
	overflow: hidden;
	background: var(--surface-2);
	box-shadow: 0 16px 48px rgba(0,0,0,.7);
}
.tc-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tc-title {
	font-size: 24px;
	font-weight: 700;
	letter-spacing: -0.5px;
	line-height: 1.2;
	text-align: center;
}
.tc-artist {
	font-size: 16px;
	color: rgba(255,255,255,.65);
	font-weight: 500;
	text-align: center;
	margin-top: -8px;
}
.tc-links {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	justify-content: center;
	margin-top: 12px;
}
.tc-link {
	display: inline-flex;
	align-items: center;
	padding: 12px 24px;
	border-radius: 22px;
	background: rgba(255,255,255,.12);
	-webkit-backdrop-filter: blur(20px);
	backdrop-filter: blur(20px);
	color: var(--fg);
	font-size: 14px;
	font-weight: 600;
	transition: background .15s, transform .12s;
	border: 1px solid rgba(255,255,255,.08);
}
.tc-link:active { background: rgba(255,255,255,.2); transform: scale(0.96); }
.tc-actions { display: flex; justify-content: center; margin-top: 16px; }
.tc-action-btn { color: var(--fg-2); border-color: rgba(255,255,255,.12); }

/* === CONTEXT MENU (iOS action sheet) === */

.ctx-menu {
	position: fixed; inset: 0;
	z-index: 40;
	display: none;
	align-items: flex-end;
	justify-content: center;
}
.ctx-menu.open { display: flex; }

.ctx-bg {
	position: absolute; inset: 0;
	background: rgba(0,0,0,.6);
	animation: bgFade .15s ease;
}

.ctx-sheet {
	position: relative;
	width: 100%;
	max-width: 400px;
	padding: 0 8px calc(8px + var(--safe-bottom));
	animation: sheetIn .25s cubic-bezier(.2,.8,.2,1);
}

@keyframes sheetIn {
	from { transform: translateY(100%); }
	to { transform: translateY(0); }
}

.ctx-header {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 16px 10px;
	background: var(--surface-2);
	border-radius: 14px 14px 0 0;
}

.ctx-thumb {
	width: 40px; height: 40px;
	border-radius: 6px;
	object-fit: cover;
	background: var(--surface-3);
	flex-shrink: 0;
}
.ctx-thumb[src=""] { display: none; }

.ctx-meta { flex: 1; min-width: 0; }
.ctx-title {
	font-size: 14px;
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.ctx-artist {
	font-size: 12px;
	color: var(--fg-2);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	margin-top: 2px;
}

.ctx-actions {
	background: var(--surface-2);
	border-radius: 0 0 14px 14px;
	overflow: hidden;
}

.ctx-action {
	display: block;
	width: 100%;
	padding: 15px 16px;
	font-size: 16px;
	font-weight: 400;
	color: var(--fg);
	text-align: center;
	border-top: 1px solid var(--surface);
	transition: background .1s;
}
.ctx-action:active { background: var(--surface-3); }

.ctx-cancel {
	display: block;
	width: 100%;
	margin-top: 8px;
	padding: 15px 16px;
	font-size: 16px;
	font-weight: 600;
	color: var(--fg);
	text-align: center;
	background: var(--surface-2);
	border-radius: 14px;
	transition: background .1s;
}
.ctx-cancel:active { background: var(--surface-3); }

/* === SHUFFLE / REPEAT === */

.p-controls .ctrl.side {
	width: 36px; height: 36px;
	color: rgba(255,255,255,.4);
	transition: color .15s, transform .15s;
}
.p-controls .ctrl.side svg { width: 20px; height: 20px; }
.p-controls .ctrl.side.active { color: var(--fg); }
.p-controls .ctrl.side:active { transform: scale(0.88); }

/* === PLAYER ACCENT (color extraction) === */

.p-prog .fill { background: var(--player-accent, rgba(255,255,255,.85)); }
.p-prog .thumb { background: var(--player-accent, #fff); }
.mp-fill { background: var(--player-accent, var(--fg)); }

/* === PLAYLISTS VIEW (active) === */

#view-playlists .pl-actions { padding: 12px 16px 8px; }
#view-playlists .list { padding-bottom: 60px; }

.pl-beta {
	position: fixed;
	bottom: calc(12px + var(--safe-bottom));
	left: 0; right: 0;
	text-align: center;
	font-size: 11px;
	color: var(--fg-3);
	pointer-events: none;
}

/* === QUEUE PANEL === */

.queue-panel {
	position: fixed;
	inset: 0;
	z-index: 12;
	background: var(--bg);
	display: none;
	flex-direction: column;
	overflow: hidden;
}
.queue-panel.open { display: flex; animation: playerIn .3s cubic-bezier(.2,.8,.2,1); }

.q-header {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 12px;
	padding-top: calc(8px + var(--safe-top));
	border-bottom: 1px solid var(--line);
}
.q-title {
	flex: 1;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 1.2px;
	text-transform: uppercase;
	color: var(--fg-2);
}
.q-count {
	font-size: 12px;
	color: var(--fg-3);
	font-feature-settings: "tnum";
}

.q-body {
	flex: 1;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	padding: 8px 0 calc(40px + var(--safe-bottom));
}

.q-section {
	padding: 12px 16px 4px;
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: 1.2px;
	text-transform: uppercase;
	color: var(--fg-3);
}

.q-row {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 12px 8px 6px;
	min-height: 56px;
	transition: background .12s, opacity .2s, transform .15s;
}
.q-row:active { background: var(--surface-2); }
.q-row.now { background: var(--surface); border-radius: 10px; margin: 0 8px; }
.q-actions {
	display: flex; align-items: center; gap: 2px; flex-shrink: 0;
}
.q-move {
	width: 32px; height: 32px;
	display: flex; align-items: center; justify-content: center;
	color: var(--fg-3);
	border-radius: 50%;
	transition: background .12s, color .12s;
}
.q-move:active { background: var(--surface-3); color: var(--fg); }
.q-move[disabled] { opacity: .2; pointer-events: none; }
.q-move svg { width: 16px; height: 16px; }

.q-row .q-art {
	width: 40px; height: 40px;
	border-radius: 6px;
	overflow: hidden;
	background: var(--surface-2);
	flex-shrink: 0;
}
.q-row .q-art img { width: 100%; height: 100%; object-fit: cover; display: block; }

.q-row .q-info { flex: 1; min-width: 0; }
.q-row .q-info .t {
	font-size: 14px;
	font-weight: 500;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.q-row .q-info .a {
	font-size: 12px;
	color: var(--fg-2);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	margin-top: 2px;
}

.q-remove {
	width: 32px; height: 32px;
	display: flex; align-items: center; justify-content: center;
	color: var(--fg-3);
	flex-shrink: 0;
	border-radius: 50%;
	transition: background .12s, color .12s;
}
.q-remove:active { background: var(--surface-3); color: var(--fg); }
.q-remove svg { width: 16px; height: 16px; }

/* Queue button in player */
.p-queue-btn {
	width: 40px; height: 40px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	color: rgba(255,255,255,.5);
	transition: color .15s, background .15s;
}
.p-queue-btn:active { color: var(--fg); background: rgba(255,255,255,.08); }
.p-queue-btn .bicon { width: 20px; height: 20px; display: inline-flex; }
.p-queue-btn .bicon svg { width: 20px; height: 20px; }
/* radio toggle: dim when off, full white when on */
#p-radio.active { color: var(--fg); }

/* Like button in player */
.p-like-btn {
	width: 40px; height: 40px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	color: rgba(255,255,255,.5);
	transition: color .15s, transform .15s;
}
.p-like-btn:active { transform: scale(0.88); }
.p-like-btn.liked { color: var(--red); }
.p-like-btn .bicon { width: 20px; height: 20px; display: inline-flex; }
.p-like-btn .bicon svg { width: 20px; height: 20px; }

/* Liked cover in playlists tab */
.liked-cover {
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, #3d1f2a, #3d1f1f);
	color: var(--red);
}
.liked-cover svg { width: 24px; height: 24px; }

/* Cache management */
.cache-mgmt { padding: 16px; text-align: center; border-top: 1px solid var(--line); margin-top: 8px; }
.cache-mgmt[hidden] { display: none; }
.cache-info { font-size: 12px; color: var(--fg-3); margin-bottom: 10px; }
.cache-clear-btn {
	font-size: 13px;
	color: var(--red);
	font-weight: 500;
	padding: 8px 16px;
	border-radius: 8px;
	transition: background .12s;
}
.cache-clear-btn:active { background: var(--surface-2); }

/* === Accessibility: respect prefers-reduced-motion ===
   Kills decorative/looping motion and collapses transitions to instant when
   the OS asks for reduced motion (iOS Settings → Accessibility → Motion).
   Functional state changes still apply, just without the slide/fade. */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .01ms !important;
		scroll-behavior: auto !important;
	}
	.p-art.playing { animation: none; } /* album-art breathing */
}

/* ── search-only composition ──────────────────────────────────────────
 * The generated field is the design. Everything else is a hairline and a
 * caret, sitting at optical centre until there is something to read — then
 * the field recedes and the results take the screen.
 */
#view-search {
	position: relative;
	z-index: 1;
}
.hero {
	padding: 34vh 22px 12px;
	text-align: center;
	transition: padding-top .45s cubic-bezier(.22,.61,.36,1);
}
body.has-results .hero { padding-top: 10px; }

/* the field steps back while you are reading results */
body.has-results #flow-bg { opacity: .28; }

/* no box, no fill: a rule the text sits on */
.search-wrap {
	background: none;
	border-radius: 0;
	padding: 0 2px 9px;
	height: auto;
	gap: 10px;
	border-bottom: 1px solid rgba(255,255,255,.22);
	box-shadow: none;
	transition: border-color .25s ease;
}
.search-wrap:focus-within {
	background: none;
	box-shadow: none;
	border-bottom-color: rgba(255,255,255,.62);
}
.hero #q {
	font-size: 19px;
	font-weight: 300;
	letter-spacing: .2px;
	text-align: center;
	caret-color: #fff;
}
.hero #q::placeholder {
	font-weight: 300;
	letter-spacing: .2px;
	opacity: .42;
}
/* icon carries no information next to a placeholder that already says it */
.hero .search-icon { display: none; }

/* navigation stays reachable but stops competing with the field */
#topbar { background: none; backdrop-filter: none; }
body:not(.has-results) #view-search ~ #topbar,
body:not(.has-results) #topbar .tabs { opacity: .55; }
#topbar .tabs { transition: opacity .3s ease; }
body.has-results #topbar .tabs { opacity: 1; }

/* results need to stay readable over a lit background */
#results > li { position: relative; z-index: 1; }

@media (prefers-reduced-motion: reduce) {
	.hero, #flow-bg, #topbar .tabs { transition: none; }
}

/* ── animated hint ────────────────────────────────────────────────────
 * One orchestrated moment on open: the hint types through what the field
 * accepts, then settles and stays put. It never loops — a placeholder that
 * keeps moving while you think is a tax, not a feature.
 */
.search-wrap { position: relative; }
.hero .ph {
	position: absolute;
	left: 0;
	right: 0;
	top: 50%;
	transform: translateY(-50%);
	margin-top: -4px;              /* optical centre against the rule below */
	pointer-events: none;
	text-align: center;
	font-size: 19px;
	font-weight: 300;
	letter-spacing: .2px;
	color: rgba(255,255,255,.42);
	white-space: nowrap;
	overflow: hidden;
	transition: opacity .18s ease;
}
.hero .ph.gone { opacity: 0; }
.hero .ph.typing::after {
	content: '';
	display: inline-block;
	width: 1px;
	height: 1.05em;
	margin-left: 3px;
	background: rgba(255,255,255,.75);
	vertical-align: -.18em;
	animation: ph-blink 1.05s steps(1) infinite;
}
@keyframes ph-blink { 0%, 50% { opacity: 1 } 50.01%, 100% { opacity: 0 } }

@media (prefers-reduced-motion: reduce) {
	.hero .ph.typing::after { animation: none; }
}

/* ── legibility scrim ─────────────────────────────────────────────────
 * The field is lit, the type on it is not. This sits between them: darkest
 * through the middle band where the search rule lives, and along the top and
 * bottom edges behind the tabs and the mini player. Without it a bright
 * highlight can land straight under the text.
 */
#bg-scrim {
	position: fixed;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	/* Edges only. The central radial was pinned to 44% height while the content
	   moves, so it read as a smudge sitting in the wrong place. Legibility for
	   the search line is handled locally by its own text-shadow instead. */
	background:
		linear-gradient(180deg,
			rgba(0,0,0,.70) 0%, rgba(0,0,0,.16) 15%,
			rgba(0,0,0,.16) 78%, rgba(0,0,0,.78) 100%);
	transition: opacity .5s ease;
}
body.has-results #bg-scrim { opacity: .75; }
html.no-gl #bg-scrim { display: none; }

/* type now sits on a controlled backdrop, so it can afford real contrast */
.hero #q { color: #fff; }
.hero .ph { color: rgba(255,255,255,.58); }
.hero .search-wrap { border-bottom-color: rgba(255,255,255,.34); }
.hero .search-wrap:focus-within { border-bottom-color: rgba(255,255,255,.78); }

/* local legibility instead of a global haze */
.hero #q, .hero .ph {
	text-shadow: 0 1px 14px rgba(0,0,0,.85), 0 0 3px rgba(0,0,0,.6);
}

/* справка lives on the main screen only */
.info-btn { display: none; }
body.on-search .info-btn { display: flex; }
