/* ✹✺ Audio Player — dark glass player. Colours can be changed with the custom properties below. */
.osb-audio {
	--osb-audio-bg: rgba(11, 13, 20, .88);
	--osb-audio-line: rgba(180, 190, 220, .18);
	--osb-audio-text: #dfe2ec;
	--osb-audio-muted: #8a90a4;
	--osb-audio-accent: #8cc8ff;
	box-sizing: border-box;
	width: 360px;
	max-width: 100%;
	padding: 10px 12px 8px;
	border: 1px solid var(--osb-audio-line);
	border-radius: 16px;
	background: var(--osb-audio-bg);
	-webkit-backdrop-filter: blur(14px);
	backdrop-filter: blur(14px);
	color: var(--osb-audio-text);
	font: 13px/1.35 "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
	box-shadow: 0 12px 40px rgba(0, 0, 0, .45);
}
.osb-audio *, .osb-audio *::before, .osb-audio *::after { box-sizing: border-box; }
.osb-audio:not(.is-ready) { visibility: hidden; }
.osb-audio--inline { margin: 1.5em 0; width: 100%; max-width: 560px; }
.osb-audio--floating { position: fixed; z-index: 99990; bottom: max(16px, env(safe-area-inset-bottom)); }
.osb-audio--left { left: 16px; }
.osb-audio--right { right: 16px; }
body.osb-board-page .osb-audio--right { right: 124px; } /* keep clear of the board minimap */
body.osb-board-page .osb-board-help { display: none; }

.osb-audio-bar { display: flex; align-items: center; gap: 4px; }
.osb-audio-btn {
	flex: none;
	display: inline-grid;
	place-items: center;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: inherit;
	cursor: pointer;
	transition: background .15s, color .15s;
}
.osb-audio-btn svg { width: 20px; height: 20px; fill: currentColor; }
.osb-audio-btn:hover { background: rgba(255, 255, 255, .08); }
.osb-audio-btn:focus-visible, .osb-audio-item:focus-visible, .osb-audio-add:focus-within { outline: 2px solid var(--osb-audio-accent); outline-offset: 2px; }
.osb-audio-play { width: 40px; height: 40px; background: var(--osb-audio-text); color: #05060a; }
.osb-audio-play:hover { background: #fff; }
.osb-audio-play svg { width: 22px; height: 22px; }
.osb-audio-listbtn[aria-expanded="true"] { color: var(--osb-audio-accent); }

.osb-audio-info { flex: 1; min-width: 0; padding: 0 6px; }
.osb-audio-title, .osb-audio-artist { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.osb-audio-title { font-weight: 500; }
.osb-audio-artist { color: var(--osb-audio-muted); font-size: 12px; }
.osb-audio-artist:empty { display: none; }
.osb-audio.is-empty .osb-audio-prev,
.osb-audio.is-empty .osb-audio-next,
.osb-audio.is-empty .osb-audio-seek { opacity: .35; pointer-events: none; }

.osb-audio-seek { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.osb-audio-time { flex: none; min-width: 34px; color: var(--osb-audio-muted); font: 11px/1 "JetBrains Mono", ui-monospace, Menlo, monospace; font-variant-numeric: tabular-nums; }
.osb-audio-seek .osb-audio-time:first-child { text-align: right; }
.osb-audio-volbtn { width: 28px; height: 28px; }
.osb-audio-volbtn svg { width: 17px; height: 17px; }

.osb-audio-range {
	--p: 0%;
	flex: 1;
	min-width: 0;
	height: 16px;
	margin: 0;
	background: transparent;
	-webkit-appearance: none;
	appearance: none;
	cursor: pointer;
}
.osb-audio-vol { flex: 0 0 64px; }
.osb-audio-range::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(to right, var(--osb-audio-accent) var(--p), rgba(255, 255, 255, .16) var(--p)); }
.osb-audio-range::-moz-range-track { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .16); }
.osb-audio-range::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--osb-audio-accent); }
.osb-audio-range::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; margin-top: -4px; border-radius: 50%; background: #fff; border: 0; }
.osb-audio-range::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 0; }
.osb-audio-range:focus-visible { outline: 2px solid var(--osb-audio-accent); outline-offset: 2px; border-radius: 4px; }

.osb-audio-panel { margin: 0 0 8px; padding-bottom: 8px; border-bottom: 1px solid var(--osb-audio-line); }
.osb-audio-list { max-height: 240px; margin: 0; padding: 0; overflow: auto; list-style: none; overscroll-behavior: contain; }
.osb-audio-item {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 8px 8px;
	border: 0;
	border-radius: 8px;
	background: none;
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
}
.osb-audio-item:hover { background: rgba(255, 255, 255, .06); }
.osb-audio-item.is-current { color: var(--osb-audio-accent); background: rgba(140, 200, 255, .08); }
.osb-audio-n { flex: none; width: 18px; color: var(--osb-audio-muted); font: 11px/1 "JetBrains Mono", ui-monospace, Menlo, monospace; text-align: right; }
.osb-audio-item-title { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.osb-audio-tag { flex: none; padding: 2px 6px; border-radius: 999px; background: rgba(255, 255, 255, .08); color: var(--osb-audio-muted); font-size: 10px; }
.osb-audio-none { padding: 8px; color: var(--osb-audio-muted); }
.osb-audio-add {
	position: relative;
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 6px;
	padding: 8px;
	border: 1px dashed var(--osb-audio-line);
	border-radius: 8px;
	color: var(--osb-audio-muted);
	cursor: pointer;
}
.osb-audio-add:hover { color: var(--osb-audio-text); border-color: var(--osb-audio-accent); }
.osb-audio-add svg { width: 18px; height: 18px; fill: currentColor; }
.osb-audio-add input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.osb-audio-msg { color: #ff9b9b; font-size: 12px; }
.osb-audio-msg:empty { display: none; }

/* minimised floating player: just a small arrow that brings it back (blue while music plays) */
.osb-audio-fab { display: none; }
.osb-audio.is-min { width: auto; padding: 0 !important; border-radius: 999px; box-shadow: 0 6px 20px rgba(0, 0, 0, .35); }
.osb-audio.is-min > :not(.osb-audio-fab) { display: none; }
.osb-audio.is-min .osb-audio-fab { display: grid; width: 34px; height: 34px; }
.osb-audio.is-min .osb-audio-fab svg { width: 20px; height: 20px; }
.osb-audio.is-min.is-playing .osb-audio-fab { color: var(--osb-audio-accent); }
.osb-audio.is-min.is-waiting .osb-audio-fab { animation: osb-audio-wait 1.4s ease-in-out infinite; }
@keyframes osb-audio-wait { 50% { color: var(--osb-audio-accent); } }

@media (max-width: 480px) {
	.osb-audio--floating:not(.is-min) { left: 16px; right: 16px; width: auto; }
	.osb-audio-vol { display: none; }
}
@media (prefers-reduced-motion: reduce) { .osb-audio-btn { transition: none; } .osb-audio.is-min.is-waiting .osb-audio-fab { animation: none; } }

/* light (white) look: follows the site's dark / light switch (html[data-theme]) or the device setting */
:root[data-theme="light"] .osb-audio {
	--osb-audio-bg: rgba(255, 255, 255, .94);
	--osb-audio-line: rgba(20, 30, 60, .14);
	--osb-audio-text: #171a24;
	--osb-audio-muted: #5d6478;
	--osb-audio-accent: #2864d8;
	box-shadow: 0 12px 40px rgba(20, 30, 60, .16);
}
@media (prefers-color-scheme: light) {
	:root:not([data-theme]) .osb-audio {
		--osb-audio-bg: rgba(255, 255, 255, .94); --osb-audio-line: rgba(20, 30, 60, .14); --osb-audio-text: #171a24;
		--osb-audio-muted: #5d6478; --osb-audio-accent: #2864d8; box-shadow: 0 12px 40px rgba(20, 30, 60, .16);
	}
}
:root[data-theme="light"] .osb-audio-play { color: #fff; }
:root[data-theme="light"] .osb-audio-play:hover { background: #000; }
:root[data-theme="light"] .osb-audio-btn:hover { background: rgba(20, 30, 60, .07); }
:root[data-theme="light"] .osb-audio-range::-webkit-slider-runnable-track { background: linear-gradient(to right, var(--osb-audio-accent) var(--p), rgba(20, 30, 60, .15) var(--p)); }
:root[data-theme="light"] .osb-audio-range::-moz-range-track { background: rgba(20, 30, 60, .15); }
:root[data-theme="light"] .osb-audio-range::-webkit-slider-thumb { background: #171a24; }
:root[data-theme="light"] .osb-audio-range::-moz-range-thumb { background: #171a24; }
:root[data-theme="light"] .osb-audio-item:hover, :root[data-theme="light"] .osb-audio-tag { background: rgba(20, 30, 60, .07); }
:root[data-theme="light"] .osb-audio-item.is-current { background: rgba(40, 100, 216, .1); }
