/* Reset within the bar so theme button/list styles can't distort it.
   NOTE: no background here — backgrounds are set per-control below (and the
   play button uses !important so a theme can't strip its accent fill). */
.iwsp-bar, .iwsp-bar *, .iwsp-bar-reopen { box-sizing: border-box; }
.iwsp-bar [hidden], .iwsp-bar-reopen[hidden] { display: none !important; }
.iwsp-bar button, .iwsp-bar-reopen {
	-webkit-appearance: none; appearance: none;
	margin: 0; padding: 0; min-width: 0;
	border: none; box-shadow: none; text-shadow: none;
	font-family: inherit; line-height: 1; letter-spacing: normal;
	-webkit-tap-highlight-color: transparent;
}

.iwsp-bar {
	position: fixed;
	left: 0; right: 0; bottom: 0;
	z-index: 99990;
	background: #ffffff;
	border-top: 1px solid rgba(0,0,0,.10);
	box-shadow: 0 -4px 20px rgba(0,0,0,.08);
	font-family: inherit;
	color: #1a1a1a;
	padding-bottom: env(safe-area-inset-bottom, 0px);
}
.iwsp-bar[data-mode="dark"] { background: #17171c; color: #f2f2f5; border-top-color: rgba(255,255,255,.12); }

.iwsp-bar-line { display: none; height: 3px; width: 100%; background: rgba(0,0,0,.08); }
.iwsp-bar[data-mode="dark"] .iwsp-bar-line { background: rgba(255,255,255,.14); }
.iwsp-bar-line-fill { display: block; height: 100%; width: 0%; background: var(--iwsp-bar-accent, #7c3aed); transition: width .15s linear; }

.iwsp-bar-inner {
	max-width: 1080px; width: 100%; margin: 0 auto;
	display: flex; align-items: center; gap: 14px;
	padding: 8px 16px;
}
.iwsp-bar-now { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 0; }
.iwsp-bar-cover { width: 46px; height: 46px; min-width: 46px; border-radius: 8px; object-fit: cover; background: rgba(0,0,0,.06); flex: none; }
.iwsp-bar-meta { display: flex; flex-direction: column; min-width: 0; }
.iwsp-bar-title { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iwsp-bar-creator { font-size: 12px; opacity: .7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.iwsp-bar-controls { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.iwsp-bar .iwsp-bar-btn {
	flex: 0 0 auto;
	width: 40px; height: 40px; min-width: 40px; max-width: 40px;
	border-radius: 50%; font-size: 15px; color: inherit; cursor: pointer;
	background: transparent;
	display: inline-flex; align-items: center; justify-content: center;
}
.iwsp-bar .iwsp-bar-btn:hover { background: rgba(0,0,0,.07); }
.iwsp-bar[data-mode="dark"] .iwsp-bar-btn:hover { background: rgba(255,255,255,.12); }
.iwsp-bar .iwsp-bar-play {
	width: 46px !important; height: 46px !important; min-width: 46px; max-width: 46px;
	border-radius: 50%; font-size: 16px;
	color: #fff !important;
	background: var(--iwsp-bar-accent, #7c3aed) !important;
}
.iwsp-bar .iwsp-bar-play:hover { background: var(--iwsp-bar-accent, #7c3aed) !important; filter: brightness(1.06); }

.iwsp-bar-progress { display: flex; align-items: center; gap: 8px; flex: 1 1 0; min-width: 120px; max-width: 420px; }
.iwsp-bar-seek { flex: 1; width: auto; accent-color: var(--iwsp-bar-accent, #7c3aed); cursor: pointer; }
.iwsp-bar-cur, .iwsp-bar-dur { font-size: 12px; opacity: .7; font-variant-numeric: tabular-nums; min-width: 34px; }
.iwsp-bar .iwsp-bar-close { width: 36px; height: 36px; min-width: 36px; border-radius: 50%; color: inherit; cursor: pointer; font-size: 15px; opacity: .55; flex: none; background: transparent; display: inline-flex; align-items: center; justify-content: center; }
.iwsp-bar .iwsp-bar-close:hover { opacity: 1; background: rgba(0,0,0,.07); }

.iwsp-bar-reopen {
	position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px));
	z-index: 99991;
	width: 52px; height: 52px; min-width: 52px; border-radius: 50%;
	background: var(--iwsp-bar-accent, #7c3aed) !important; color: #fff !important;
	font-size: 22px; cursor: pointer;
	box-shadow: 0 4px 16px rgba(0,0,0,.28);
	display: inline-flex; align-items: center; justify-content: center;
}
.iwsp-bar-reopen:hover { filter: brightness(1.06); }

body.iwsp-bar-open { padding-bottom: calc(66px + env(safe-area-inset-bottom, 0px)); }

html.iwsp-nav-loading::after {
	content: ""; position: fixed; top: 0; left: 0; height: 3px; width: 100%;
	z-index: 99999; background: var(--iwsp-bar-accent, #7c3aed);
	transform-origin: 0 50%; animation: iwsp-nav-progress 1.1s ease-in-out infinite;
}
@keyframes iwsp-nav-progress { 0% { transform: scaleX(0); opacity: .9; } 50% { transform: scaleX(.7); } 100% { transform: scaleX(1); opacity: .3; } }

@media (max-width: 640px) {
	.iwsp-bar-line { display: block; }
	.iwsp-bar-progress { display: none; }
	.iwsp-bar-creator { display: none; }
	.iwsp-bar-inner { gap: 8px; padding: 7px 10px; }
	.iwsp-bar-cover { width: 42px; height: 42px; min-width: 42px; }
	.iwsp-bar-now { flex: 1 1 auto; }
	.iwsp-bar-title { font-size: 13.5px; }
	.iwsp-bar .iwsp-bar-btn { width: 44px; height: 44px; min-width: 44px; max-width: 44px; }
	.iwsp-bar-prev { display: none; }
	body.iwsp-bar-open { padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 360px) { .iwsp-bar-cover { display: none; } }

@media (prefers-reduced-motion: reduce) {
	.iwsp-bar-line-fill { transition: none; }
	html.iwsp-nav-loading::after { animation: none; opacity: .6; }
}
