/* BMedia Player — phone-first, dark by default, light when the system is light */
#bmedia-root {
	--bg: #0b0b16; --bg2: #16162c; --card: rgba(255,255,255,.06); --card2: rgba(255,255,255,.11);
	--line: rgba(255,255,255,.08); --text: #f5f5ff; --muted: #a0a0c0;
	--a1: #ff4d8d; --a2: #7c5cff; --tint: #7c5cff;
	--grad: linear-gradient(135deg, var(--a1), var(--a2));
	--r: 18px; --tab-h: 68px; --mini-h: 64px;
	--top: var(--header-height, 50px);
	position: fixed; inset: 0; z-index: 10;
	background: radial-gradient(1200px 600px at 10% -10%, color-mix(in srgb, var(--tint) 35%, transparent), transparent 60%), var(--bg);
	color: var(--text); font: 15px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans Tamil", sans-serif;
	overflow: hidden; -webkit-font-smoothing: antialiased; transition: background .8s;
	-webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none;
}
@media (prefers-color-scheme: light) {
	#bmedia-root { --bg: #f6f5fb; --bg2: #fff; --card: rgba(20,20,60,.05); --card2: rgba(20,20,60,.09); --line: rgba(20,20,60,.08); --text: #17172b; --muted: #6b6b88; }
}
#bmedia-root *, #bmedia-root *::before, #bmedia-root *::after { box-sizing: border-box; }
#bmedia-root button { all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
#bmedia-root img { display: block; }
#bmedia-root h1, #bmedia-root h2, #bmedia-root h3 { margin: 0; color: inherit; font-weight: 800; }
#bmedia-root .bm-loading { display: grid; place-items: center; height: 100%; font-size: 28px; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; animation: bm-pulse 1.2s infinite; }

/* ---------- layout */
#bmedia-root .bm-scroll { position: absolute; inset: 0 0 calc(var(--tab-h) + env(safe-area-inset-bottom)) 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 14px 16px calc(var(--mini-h) + 28px); scrollbar-width: none; }
#bmedia-root .bm-scroll::-webkit-scrollbar { display: none; }
#bmedia-root .bm-wrap { max-width: 1100px; margin: 0 auto; }
#bmedia-root .bm-view { animation: bm-in .32s cubic-bezier(.2,.8,.2,1); }
@keyframes bm-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes bm-pulse { 50% { opacity: .5; } }
@keyframes bm-pop { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
@keyframes bm-float { 50% { transform: translateY(-6px) rotate(-14deg); } }
@keyframes bm-spin { to { transform: rotate(360deg); } }
@keyframes bm-shimmer { to { background-position: -200% 0; } }
@keyframes bm-rise { from { opacity: 0; transform: translateY(16px) scale(.97); } }

#bmedia-root .bm-top { display: flex; align-items: center; gap: 10px; margin: 4px 0 14px; }
#bmedia-root .bm-top h1 { font-size: 28px; letter-spacing: -.5px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#bmedia-root .bm-top h1 .g { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
#bmedia-root .bm-hello { color: var(--muted); font-size: 14px; margin: -8px 0 14px; }
#bmedia-root .bm-icon { width: 42px; height: 42px; border-radius: 50%; background: var(--card); font-size: 18px; transition: transform .15s, background .2s; flex-shrink: 0; color: var(--text); }
#bmedia-root .bm-icon:active { transform: scale(.88); }

#bmedia-root h2.bm-h { font-size: 20px; margin: 26px 0 12px; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
#bmedia-root h2.bm-h small { font-size: 13px; color: var(--a1); font-weight: 700; cursor: pointer; }

/* press feedback + staggered entrance */
#bmedia-root .bm-tap { transition: transform .14s cubic-bezier(.3,.7,.4,1.4), filter .2s; cursor: pointer; }
#bmedia-root .bm-tap:active { transform: scale(.95); filter: brightness(.9); }
#bmedia-root .bm-stagger > * { animation: bm-rise .45s cubic-bezier(.2,.8,.2,1) backwards; }
#bmedia-root .bm-stagger > *:nth-child(2) { animation-delay: .04s } #bmedia-root .bm-stagger > *:nth-child(3) { animation-delay: .08s }
#bmedia-root .bm-stagger > *:nth-child(4) { animation-delay: .12s } #bmedia-root .bm-stagger > *:nth-child(5) { animation-delay: .16s }
#bmedia-root .bm-stagger > *:nth-child(6) { animation-delay: .2s } #bmedia-root .bm-stagger > *:nth-child(n+7) { animation-delay: .24s }

/* ---------- hero continue card */
#bmedia-root .bm-hero { position: relative; border-radius: 24px; overflow: hidden; padding: 18px; display: flex; gap: 14px; align-items: center; min-height: 112px; background: var(--grad); color: #fff; box-shadow: 0 16px 40px -12px color-mix(in srgb, var(--a2) 70%, transparent); }
#bmedia-root .bm-hero .bg { position: absolute; inset: -20px; background-size: cover; background-position: center; filter: blur(24px) saturate(1.4); opacity: .55; }
#bmedia-root .bm-hero > *:not(.bg) { position: relative; }
#bmedia-root .bm-hero .art { width: 76px; height: 76px; border-radius: 16px; box-shadow: 0 8px 20px rgba(0,0,0,.35); font-size: 22px; }
#bmedia-root .bm-hero .t { flex: 1; min-width: 0; }
#bmedia-root .bm-hero small { opacity: .85; font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px; font-weight: 800; }
#bmedia-root .bm-hero b { display: block; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#bmedia-root .bm-hero span { font-size: 13px; opacity: .85; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#bmedia-root .bm-hero .play { width: 54px; height: 54px; border-radius: 50%; background: #fff; color: #111; font-size: 22px; box-shadow: 0 6px 18px rgba(0,0,0,.3); flex-shrink: 0; }

/* ---------- category tiles */
#bmedia-root .bm-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
#bmedia-root .bm-cat { position: relative; overflow: hidden; height: 92px; border-radius: var(--r); padding: 12px 14px; color: #fff; font-weight: 800; font-size: 15px; line-height: 1.15; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12), 0 10px 22px -14px rgba(0,0,0,.6); text-shadow: 0 1px 6px rgba(0,0,0,.2); }
#bmedia-root .bm-cat::after { content: ""; position: absolute; inset: 0; background: linear-gradient(160deg, rgba(255,255,255,.25), transparent 55%); pointer-events: none; }
#bmedia-root .bm-cat em { position: absolute; right: -4px; bottom: -8px; font-size: 50px; font-style: normal; transform: rotate(-14deg); filter: drop-shadow(0 6px 10px rgba(0,0,0,.3)); }
#bmedia-root .bm-cat:hover em { animation: bm-float 1.4s ease-in-out infinite; }
#bmedia-root .bm-cat small { display: block; font-weight: 600; font-size: 11px; opacity: .9; margin-top: 3px; }
#bmedia-root .bm-cat.wide { grid-column: span 2; height: 104px; font-size: 18px; }

/* ---------- chips & segmented */
#bmedia-root .bm-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 16px 6px; margin: 0 -16px 8px; }
#bmedia-root .bm-chips::-webkit-scrollbar { display: none; }
#bmedia-root .bm-chip { padding: 9px 15px; border-radius: 999px; background: var(--card); font-size: 13px; font-weight: 700; white-space: nowrap; transition: background .2s, color .2s, transform .15s; }
#bmedia-root .bm-chip:active { transform: scale(.93); }
#bmedia-root .bm-chip.on { background: var(--text); color: var(--bg); }
#bmedia-root .bm-seg { display: flex; background: var(--card); border-radius: 14px; padding: 4px; margin-bottom: 14px; }
#bmedia-root .bm-seg button { flex: 1; padding: 9px 4px; border-radius: 10px; font-weight: 800; font-size: 13px; color: var(--muted); transition: color .2s, background .25s; }
#bmedia-root .bm-seg button.on { background: var(--bg2); color: var(--text); box-shadow: 0 2px 10px rgba(0,0,0,.18); }

/* ---------- search box */
#bmedia-root .bm-search { display: flex; align-items: center; gap: 8px; background: var(--card); border-radius: 14px; padding: 0 12px; margin-bottom: 14px; }
#bmedia-root .bm-search input { all: unset; flex: 1; padding: 12px 0; font-size: 16px; color: var(--text); user-select: text; -webkit-user-select: text; }
#bmedia-root .bm-search input::placeholder { color: var(--muted); }

/* ---------- horizontal rows */
#bmedia-root .bm-row { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 6px; }
#bmedia-root .bm-row::-webkit-scrollbar { display: none; }
#bmedia-root .bm-card { width: 132px; flex-shrink: 0; scroll-snap-align: start; }
#bmedia-root .bm-card .art { width: 132px; height: 132px; border-radius: 16px; margin-bottom: 7px; box-shadow: 0 10px 24px -10px rgba(0,0,0,.5); font-size: 30px; }
#bmedia-root .bm-card b { font-size: 13px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#bmedia-root .bm-card span { font-size: 12px; color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- artwork (image or gradient letter) */
#bmedia-root .bm-art { position: relative; overflow: hidden; display: grid; place-items: center; color: #fff; font-weight: 800; flex-shrink: 0; }
#bmedia-root .bm-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .4s; }
#bmedia-root .bm-art img.ok { opacity: 1; }
#bmedia-root .bm-art .ph { font-size: 1.15em; text-shadow: 0 2px 8px rgba(0,0,0,.25); }

/* ---------- lists */
#bmedia-root .bm-list { display: flex; flex-direction: column; }
#bmedia-root .bm-item { display: flex; align-items: center; gap: 12px; padding: 8px 6px; margin: 0 -6px; border-radius: 14px; transition: background .2s; }
@media (hover: hover) { #bmedia-root .bm-item:hover { background: var(--card); } }
#bmedia-root .bm-item .art { width: 50px; height: 50px; border-radius: 12px; font-size: 18px; }
#bmedia-root .bm-item .t { flex: 1; min-width: 0; }
#bmedia-root .bm-item b { display: block; font-size: 15px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#bmedia-root .bm-item span { display: block; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#bmedia-root .bm-item.now b { color: var(--a1); }
#bmedia-root .bm-item .more { width: 38px; height: 38px; border-radius: 50%; color: var(--muted); font-size: 20px; }
#bmedia-root .bm-live { display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .5px; background: #e0245e; color: #fff; border-radius: 6px; padding: 2px 6px; margin-left: 6px; vertical-align: 2px; }
#bmedia-root .bm-live::before { content: "●"; margin-right: 3px; animation: bm-pulse 1s infinite; }

/* animated equalizer bars on the playing item */
#bmedia-root .bm-eq { display: none; gap: 2px; height: 16px; align-items: flex-end; }
#bmedia-root .bm-item.now .bm-eq, #bmedia-root .bm-eq.show { display: inline-flex; }
#bmedia-root .bm-eq i { width: 3px; background: var(--a1); border-radius: 2px; animation: bm-eqa .9s ease-in-out infinite; }
#bmedia-root .bm-eq i:nth-child(2) { animation-delay: -.3s; } #bmedia-root .bm-eq i:nth-child(3) { animation-delay: -.6s; }
#bmedia-root.paused .bm-eq i { animation-play-state: paused; }
@keyframes bm-eqa { 0%,100% { height: 4px; } 50% { height: 16px; } }

/* ---------- action buttons */
#bmedia-root .bm-actions { display: flex; gap: 10px; margin: 4px 0 14px; }
#bmedia-root .bm-btn { flex: 1; padding: 13px; border-radius: 14px; font-weight: 800; gap: 8px; background: var(--card); transition: transform .15s; }
#bmedia-root .bm-btn:active { transform: scale(.95); }
#bmedia-root .bm-btn.primary { background: var(--grad); color: #fff; box-shadow: 0 10px 24px -10px var(--a1); }

/* ---------- grids for videos / photos / albums */
#bmedia-root .bm-vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
#bmedia-root .bm-v { position: relative; aspect-ratio: 16/10; border-radius: 14px; overflow: hidden; }
#bmedia-root .bm-v .bm-art { position: absolute; inset: 0; font-size: 26px; }
#bmedia-root .bm-v::after { content: "▶"; position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); width: 42px; height: 42px; border-radius: 50%; background: rgba(0,0,0,.45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); color: #fff; display: grid; place-items: center; font-size: 14px; }
#bmedia-root .bm-v .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 6px; background: linear-gradient(transparent, rgba(0,0,0,.75)); color: #fff; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#bmedia-root .bm-pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 3px; margin: 0 -12px; }
#bmedia-root .bm-pgrid .bm-art { aspect-ratio: 1; border-radius: 4px; font-size: 20px; }
#bmedia-root .bm-month { font-weight: 800; font-size: 15px; margin: 18px 0 8px; position: sticky; top: -14px; z-index: 2; padding: 8px 0; background: linear-gradient(var(--bg) 70%, transparent); }
#bmedia-root .bm-agrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
#bmedia-root .bm-agrid .bm-card { width: 100%; }
#bmedia-root .bm-agrid .bm-card .art { width: 100%; height: auto; aspect-ratio: 1; }

/* ---------- category page header */
#bmedia-root .bm-cathead { position: relative; border-radius: 26px; padding: 22px 18px; margin-bottom: 16px; color: #fff; overflow: hidden; min-height: 150px; display: flex; flex-direction: column; justify-content: flex-end; box-shadow: 0 20px 40px -20px rgba(0,0,0,.6); }
#bmedia-root .bm-cathead::after { content: ""; position: absolute; inset: 0; background: linear-gradient(160deg, rgba(255,255,255,.22), transparent 50%); pointer-events: none; }
#bmedia-root .bm-cathead em { position: absolute; right: 10px; top: 6px; font-size: 92px; font-style: normal; transform: rotate(-12deg); animation: bm-float 3s ease-in-out infinite; }
#bmedia-root .bm-cathead .bm-icon { position: absolute; left: 12px; top: 12px; background: rgba(0,0,0,.25); color: #fff; z-index: 1; }
#bmedia-root .bm-cathead h1 { font-size: 30px; position: relative; }
#bmedia-root .bm-cathead p { margin: 4px 0 0; opacity: .9; position: relative; }

/* ---------- skeleton + empty */
#bmedia-root .bm-skel { border-radius: 14px; background: linear-gradient(90deg, var(--card) 25%, var(--card2) 50%, var(--card) 75%); background-size: 200% 100%; animation: bm-shimmer 1.2s infinite linear; }
#bmedia-root .bm-skel.row { height: 58px; margin-bottom: 8px; }
#bmedia-root .bm-empty { text-align: center; color: var(--muted); padding: 40px 16px; }
#bmedia-root .bm-empty b { display: block; font-size: 42px; margin-bottom: 8px; }
#bmedia-root .bm-empty .bm-btn { display: inline-flex; flex: none; margin-top: 14px; padding: 11px 22px; }

/* ---------- bottom tabs */
#bmedia-root .bm-tabs { position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); display: flex; justify-content: space-around; align-items: center; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(20px) saturate(1.6); -webkit-backdrop-filter: blur(20px) saturate(1.6); border-top: 1px solid var(--line); z-index: 20; }
#bmedia-root .bm-tab { flex-direction: column; gap: 3px; font-size: 11px; font-weight: 700; color: var(--muted); width: 64px; height: 100%; transition: color .2s; position: relative; }
#bmedia-root .bm-tab i { font-style: normal; font-size: 22px; filter: grayscale(1); opacity: .65; transition: transform .25s cubic-bezier(.3,.7,.4,1.6), filter .2s, opacity .2s; }
#bmedia-root .bm-tab.on { color: var(--text); }
#bmedia-root .bm-tab.on i { filter: none; opacity: 1; transform: translateY(-2px) scale(1.14); }
#bmedia-root .bm-tab.on::before { content: ""; position: absolute; top: 7px; width: 38px; height: 34px; border-radius: 12px; background: color-mix(in srgb, var(--a1) 22%, transparent); z-index: -1; }

/* ---------- mini player */
#bmedia-root .bm-mini { position: absolute; left: 10px; right: 10px; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 8px); height: var(--mini-h); border-radius: 18px; display: flex; align-items: center; gap: 10px; padding: 0 8px; z-index: 21; background: color-mix(in srgb, var(--tint) 32%, var(--bg2)); backdrop-filter: blur(24px) saturate(1.5); -webkit-backdrop-filter: blur(24px); box-shadow: 0 12px 30px -8px rgba(0,0,0,.55), inset 0 0 0 1px rgba(255,255,255,.08); transform: translateY(160%); transition: transform .45s cubic-bezier(.2,.9,.2,1.1), background .8s; touch-action: pan-y; max-width: 720px; margin: 0 auto; }
#bmedia-root .bm-mini.show { transform: none; }
#bmedia-root .bm-mini .art { width: 46px; height: 46px; border-radius: 12px; font-size: 16px; }
#bmedia-root .bm-mini .t { flex: 1; min-width: 0; }
#bmedia-root .bm-mini b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#bmedia-root .bm-mini span { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#bmedia-root .bm-mini .ctl { width: 42px; height: 42px; border-radius: 50%; font-size: 20px; color: var(--text); }
#bmedia-root .bm-mini .bar { position: absolute; left: 14px; right: 14px; bottom: 3px; height: 3px; border-radius: 3px; background: rgba(255,255,255,.12); overflow: hidden; }
#bmedia-root .bm-mini .bar i { display: block; height: 100%; width: 0; background: var(--grad); border-radius: 3px; }
#bmedia-root .bm-spinner { position: absolute; inset: 2px; border: 2.5px solid currentColor; border-right-color: transparent; border-bottom-color: transparent; border-radius: 50%; opacity: .55; animation: bm-spin .9s linear infinite; display: none; pointer-events: none; }
#bmedia-root.buffering .bm-spinner { display: block; }

/* ---------- full player */
#bmedia-root .bm-full { position: absolute; inset: 0; z-index: 40; display: flex; flex-direction: column; padding: 12px 24px calc(22px + env(safe-area-inset-bottom)); color: #fff; overflow: hidden; transform: translateY(105%); transition: transform .45s cubic-bezier(.2,.9,.2,1); background: #111; max-width: 100%; }
#bmedia-root .bm-full.show { transform: none; }
#bmedia-root .bm-full .bg { position: absolute; inset: -80px; background-size: cover; background-position: center; filter: blur(50px) saturate(1.6) brightness(.6); transform: scale(1.2); }
#bmedia-root .bm-full .shade { position: absolute; inset: 0; background: linear-gradient(180deg, color-mix(in srgb, var(--tint) 60%, transparent), rgba(0,0,0,.88)); transition: background .8s; }
#bmedia-root .bm-full > *:not(.bg):not(.shade) { position: relative; }
#bmedia-root .bm-full .col { display: flex; flex-direction: column; flex: 1; min-height: 0; width: 100%; max-width: 520px; margin: 0 auto; }
#bmedia-root .bm-full .grab { align-self: center; width: 44px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.45); margin-bottom: 8px; }
#bmedia-root .bm-full .head { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; }
#bmedia-root .bm-full .head .bm-icon { background: rgba(255,255,255,.14); color: #fff; }
#bmedia-root .bm-full .stage { flex: 1; display: grid; place-items: center; min-height: 0; padding: 16px 0; touch-action: pan-y; }
#bmedia-root .bm-full .big { width: min(78vw, 44vh, 420px); aspect-ratio: 1; border-radius: 26px; font-size: 72px; box-shadow: 0 30px 60px -20px rgba(0,0,0,.75); transition: transform .5s cubic-bezier(.2,.9,.3,1.3), opacity .3s; }
#bmedia-root .bm-full.paused .big { transform: scale(.86); }
#bmedia-root .bm-full .info { display: flex; align-items: center; gap: 12px; }
#bmedia-root .bm-full .info .t { flex: 1; min-width: 0; }
#bmedia-root .bm-full h3 { font-size: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#bmedia-root .bm-full p { margin: 2px 0 0; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#bmedia-root .bm-full .heart { width: 46px; height: 46px; font-size: 26px; color: #fff; }
#bmedia-root .bm-full .heart.on { color: var(--a1); animation: bm-pop .45s; }
#bmedia-root .bm-seek { position: relative; height: 30px; margin-top: 14px; touch-action: none; cursor: pointer; }
#bmedia-root .bm-seek .rail { position: absolute; left: 0; right: 0; top: 12px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.22); }
#bmedia-root .bm-seek .fill { position: absolute; left: 0; top: 12px; height: 5px; border-radius: 3px; background: #fff; }
#bmedia-root .bm-seek .knob { position: absolute; top: 6px; width: 17px; height: 17px; margin-left: -8px; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.4); transition: transform .15s; }
#bmedia-root .bm-seek.drag .knob { transform: scale(1.4); }
#bmedia-root .bm-seek.live { pointer-events: none; }
#bmedia-root .bm-seek.live .fill { width: 100% !important; background: linear-gradient(90deg, #e0245e, var(--a1)); opacity: .8; }
#bmedia-root .bm-seek.live .knob { display: none; }
#bmedia-root .bm-times { display: flex; justify-content: space-between; font-size: 12px; opacity: .7; font-variant-numeric: tabular-nums; }
#bmedia-root .bm-ctrls { display: flex; align-items: center; justify-content: space-between; margin: 16px 0 10px; }
#bmedia-root .bm-ctrls button { width: 54px; height: 54px; border-radius: 50%; font-size: 26px; color: #fff; transition: transform .15s, opacity .2s; }
#bmedia-root .bm-ctrls button:active { transform: scale(.82); }
#bmedia-root .bm-ctrls .mode { font-size: 20px; opacity: .45; position: relative; }
#bmedia-root .bm-ctrls .mode.on { opacity: 1; color: var(--a1); }
#bmedia-root .bm-ctrls .mode sup { position: absolute; top: 10px; right: 10px; font-size: 10px; font-weight: 800; }
#bmedia-root .bm-ctrls .pp { width: 80px; height: 80px; background: #fff; color: #111; font-size: 32px; box-shadow: 0 12px 30px -8px rgba(0,0,0,.6); }
#bmedia-root .bm-extras { display: flex; justify-content: space-around; }
#bmedia-root .bm-extras button { flex-direction: column; gap: 3px; font-size: 12px; opacity: .85; color: #fff; padding: 6px 12px; border-radius: 12px; }
#bmedia-root .bm-extras button b { font-size: 20px; }
#bmedia-root .bm-extras button.on { color: var(--a1); opacity: 1; }

/* ---------- sheets (menus, queue, sleep) */
#bmedia-root .bm-sheet-bg { position: absolute; inset: 0; background: rgba(0,0,0,.5); z-index: 60; opacity: 0; transition: opacity .25s; }
#bmedia-root .bm-sheet-bg.show { opacity: 1; }
#bmedia-root .bm-sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 61; max-height: 80%; display: flex; flex-direction: column; background: var(--bg2); color: var(--text); border-radius: 24px 24px 0 0; padding: 10px 16px calc(16px + env(safe-area-inset-bottom)); transform: translateY(100%); transition: transform .35s cubic-bezier(.2,.9,.2,1); max-width: 720px; margin: 0 auto; box-shadow: 0 -10px 40px rgba(0,0,0,.4); }
#bmedia-root .bm-sheet.show { transform: none; }
#bmedia-root .bm-sheet .grab { align-self: center; width: 40px; height: 5px; border-radius: 3px; background: var(--card2); margin-bottom: 12px; flex-shrink: 0; }
#bmedia-root .bm-sheet .sh { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
#bmedia-root .bm-sheet .sh .art { width: 48px; height: 48px; border-radius: 12px; }
#bmedia-root .bm-sheet .sh b { display: block; font-size: 16px; } #bmedia-root .bm-sheet .sh span { color: var(--muted); font-size: 13px; }
#bmedia-root .bm-sheet .body { overflow-y: auto; }
#bmedia-root .bm-sheet .opt { display: flex; width: 100%; justify-content: flex-start; gap: 14px; padding: 14px 8px; border-radius: 12px; font-size: 16px; font-weight: 650; }
#bmedia-root .bm-sheet .opt:active, #bmedia-root .bm-sheet .opt.on { background: var(--card); }
#bmedia-root .bm-sheet .opt i { font-style: normal; width: 26px; text-align: center; font-size: 20px; }

/* ---------- video + photo viewers */
#bmedia-root .bm-viewer { position: absolute; inset: 0; z-index: 50; background: #000; display: flex; flex-direction: column; animation: bm-in .25s; }
#bmedia-root .bm-viewer video { flex: 1; width: 100%; min-height: 0; background: #000; }
#bmedia-root .bm-viewer .bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; color: #fff; }
#bmedia-root .bm-viewer .bar b { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#bmedia-root .bm-viewer .bar .bm-icon { background: rgba(255,255,255,.14); color: #fff; }
#bmedia-root .bm-viewer .ph { flex: 1; position: relative; overflow: hidden; touch-action: none; }
#bmedia-root .bm-viewer .ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transition: transform .3s cubic-bezier(.2,.9,.2,1), opacity .3s; }
#bmedia-root .bm-viewer .count { color: #fff; opacity: .7; font-size: 13px; }

/* ---------- toast */
#bmedia-root .bm-toast { position: absolute; left: 50%; top: 12px; z-index: 80; transform: translate(-50%, -160%); background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 700; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.35); transition: transform .35s cubic-bezier(.2,.9,.3,1.3); max-width: 90%; text-align: center; pointer-events: none; }
#bmedia-root .bm-toast.show { transform: translate(-50%, 0); }

/* ---------- pull to refresh */
#bmedia-root .bm-ptr { position: absolute; left: 50%; top: 6px; z-index: 5; width: 36px; height: 36px; margin-left: -18px; border-radius: 50%; background: var(--bg2); box-shadow: 0 4px 14px rgba(0,0,0,.3); display: grid; place-items: center; font-size: 18px; transform: translateY(-60px); transition: transform .2s; }
#bmedia-root .bm-ptr.spin { animation: bm-spin .8s linear infinite; }

@media (min-width: 900px) {
	#bmedia-root .bm-scroll { padding-left: 32px; padding-right: 32px; }
	#bmedia-root .bm-chips, #bmedia-root .bm-row { margin: 0 -32px; padding-left: 32px; padding-right: 32px; }
	#bmedia-root .bm-cats { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}

/* ---------- full-screen "app mode": cover the Nextcloud top bar */
#bmedia-root.immersive { inset: 0; z-index: 3000; }
#bmedia-root.immersive .bm-scroll { top: env(safe-area-inset-top); }
#bmedia-root.immersive .bm-full { padding-top: calc(12px + env(safe-area-inset-top)); }
#bmedia-root.immersive .bm-viewer { padding-top: env(safe-area-inset-top); }
/* LIVE badge inside list titles stays a small pill (not a full-width block) */
#bmedia-root .bm-item b .bm-live { display: inline-block; width: auto; color: #fff; font-size: 10px; margin-left: 6px; }

/* drawn play / pause / next icons */
#bmedia-root .bm-svg { width: 1em; height: 1em; fill: currentColor; display: block; }
#bmedia-root .pp, #bmedia-root .pp-ico { position: relative; }
#bmedia-root .pp-ico { display: grid; place-items: center; }
#bmedia-root .bm-mini .ctl { font-size: 24px; }
#bmedia-root .bm-mini .ctl.pp { width: 46px; height: 46px; background: var(--text); color: var(--bg); box-shadow: 0 4px 12px rgba(0,0,0,.25); }
#bmedia-root .bm-mini .ctl.pp .bm-svg { width: 20px; height: 20px; }
#bmedia-root .bm-ctrls .pp .bm-svg { width: 34px; height: 34px; }
#bmedia-root .bm-ctrls .prev .bm-svg, #bmedia-root .bm-ctrls .next .bm-svg { width: 30px; height: 30px; }
#bmedia-root .bm-ctrls .pp .bm-spinner { inset: -5px; border-width: 3px; color: #fff; opacity: .8; }
#bmedia-root .bm-hero .play .bm-svg { width: 24px; height: 24px; }

/* standalone web app: respect the iPhone notch / home bar */
html, body { margin: 0; height: 100%; background: #0b0b16; overscroll-behavior: none; }
@media (prefers-color-scheme: light) { html, body { background: #f6f5fb; } }
#bmedia-root .bm-scroll { top: env(safe-area-inset-top); }
#bmedia-root .bm-full { padding-top: calc(12px + env(safe-area-inset-top)); }
#bmedia-root .bm-viewer { padding-top: env(safe-area-inset-top); }

/* ---------- BMedia Web extras */
#bmedia-root .bm-banner { background: linear-gradient(135deg, #3d405b, #1b1b3a); color: #fff; padding: 12px 14px; border-radius: 16px; margin-bottom: 12px; font-size: 14px; }
#bmedia-root .bm-banner b { display: inline; }
#bmedia-root .bm-store { color: var(--muted); font-size: 13px; margin: -6px 0 12px; }
#bmedia-root .bm-item .more.dl { color: var(--a1); font-size: 18px; font-weight: 800; min-width: 38px; }
#bmedia-root .bm-item .more.dl.busy { font-size: 11px; color: var(--text); background: conic-gradient(var(--a1) calc(var(--p, 0) * 1%), var(--card2) 0); border-radius: 50%; }
#bmedia-root .bm-item .more.saved { color: #1aa64a; font-size: 18px; font-weight: 800; }
#bmedia-root .bm-update { position: absolute; left: 50%; bottom: calc(var(--tab-h) + var(--mini-h) + 24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 70; background: var(--grad); color: #fff; padding: 11px 18px; border-radius: 999px; font-weight: 800; box-shadow: 0 10px 30px rgba(0,0,0,.4); white-space: nowrap; }

/* hidden mini player must not peek over the tab bar before anything plays */
#bmedia-root .bm-mini:not(.show) { visibility: hidden; transform: translateY(calc(100% + var(--tab-h) + 40px)); }

/* ---------- background photo album */
#bmedia-root .bm-bgphoto { position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: 0; transition: opacity .8s; }
#bmedia-root .bm-bgphoto.on { opacity: 1; }
#bmedia-root .bm-bgphoto .img { position: absolute; inset: -20px; background-size: cover; background-position: center; opacity: 0; transition: opacity 1.4s ease; transform: scale(1.04); }
#bmedia-root .bm-bgphoto .img.show { opacity: 1; animation: bm-kenburns 40s ease-in-out infinite alternate; }
#bmedia-root .bm-bgphoto .veil { position: absolute; inset: 0; background: var(--bg); opacity: .62; }
#bmedia-root .bm-bgphoto[data-strength="light"] .veil { opacity: .78; }
#bmedia-root .bm-bgphoto[data-strength="strong"] .veil { opacity: .42; }
@keyframes bm-kenburns { from { transform: scale(1.04) translate(0, 0); } to { transform: scale(1.14) translate(-2%, -2%); } }
#bmedia-root .bm-themes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 6px 0 14px; }
#bmedia-root .bm-theme { flex-direction: column; gap: 6px; font-size: 12px; font-weight: 700; color: var(--text); }
#bmedia-root .bm-theme i { width: 48px; height: 48px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(255,255,255,.25); transition: transform .2s; }
#bmedia-root .bm-theme.on i { box-shadow: 0 0 0 3px var(--bg2), 0 0 0 5px var(--a1); transform: scale(1.06); }
#bmedia-root .bm-setlabel { margin: 10px 0 6px; color: var(--muted); font-size: 13px; font-weight: 700; }
#bmedia-root .bm-seg button { font-size: 12px; padding: 9px 2px; }
