html.light-mode .kol-apes-waveform {
	--kol-apes-wave-base: #a8b0aa;
	--kol-apes-wave-played: #4f765d;
	--kol-apes-wave-playhead: #315440;
	--kol-apes-wave-marker: #ffffff;
	--kol-apes-wave-marker-border: #667168;
	--kol-apes-wave-text: #667168;
	--kol-apes-wave-focus: rgba(79, 118, 93, 0.34);
}

html.dark-mode .kol-apes-waveform,
body.dark-mode .kol-apes-waveform,
body[data-theme="dark"] .kol-apes-waveform {
	--kol-apes-wave-base: #7d8981;
	--kol-apes-wave-played: #b1d8bd;
	--kol-apes-wave-playhead: #b8d3c0;
	--kol-apes-wave-marker: #202521;
	--kol-apes-wave-marker-border: #a9b3ab;
	--kol-apes-wave-text: #a9b3ab;
	--kol-apes-wave-focus: rgba(145, 177, 155, 0.4);
}

.kol-apes-waveform {
	display: grid;
	position: relative;
	width: 100%;
	min-width: 0;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 9px;
	align-items: end;
	margin-top: 7px;
	color: var(--kol-apes-wave-text, #667168);
}

.kol-apes-waveform__surface {
	display: block;
	position: relative;
	width: 100%;
	min-width: 0;
	height: 54px;
	margin: 0;
	padding: 0;
	overflow: visible;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: inherit;
	box-shadow: none;
	cursor: pointer;
	touch-action: pan-y;
}

.kol-apes-waveform__surface:hover,
.kol-apes-waveform__surface:active {
	border: 0;
	background: transparent;
	box-shadow: none;
}

.kol-apes-waveform__surface:focus-visible {
	outline: 2px solid var(--kol-apes-wave-focus, rgba(79, 118, 93, 0.34));
	outline-offset: 3px;
}

.kol-apes-waveform__canvas {
	display: block;
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
}

/* These are media controls, not theme form buttons (including focus/hover). */
html body .kol-apes-waveform button.kol-apes-waveform__surface,
html body #buddypress .kol-apes-waveform button.kol-apes-waveform__surface {
	appearance: none !important;
	background: transparent !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	color: var(--kol-apes-wave-text, #667168) !important;
	min-height: 0 !important;
	padding: 0 !important;
	filter: none !important;
	transform: none !important;
}

html body .kol-apes-waveform .kol-apes-waveform__canvas {
	background: transparent !important;
	border: 0 !important;
	box-shadow: none !important;
	height: 100% !important;
	max-height: none !important;
}

.kol-apes-waveform__playhead {
	display: block;
	position: absolute;
	top: 2px;
	bottom: 2px;
	left: 0;
	width: 1px;
	transform: translateX(-0.5px);
	background: var(--kol-apes-wave-playhead, #315440);
	opacity: 0;
	pointer-events: none;
}

.kol-apes-waveform.is-playing .kol-apes-waveform__playhead,
.kol-apes-waveform[data-progress]:not([data-progress="0"]) .kol-apes-waveform__playhead {
	opacity: 0.9;
}

.kol-apes-waveform__time {
	min-width: 76px;
	padding-bottom: 1px;
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
	font-variant-numeric: tabular-nums;
	text-align: right;
	white-space: nowrap;
}

.kol-apes-waveform__markers {
	display: block;
	position: absolute;
	inset: 0;
	pointer-events: none;
}

.kol-apes-waveform__marker {
	display: grid;
	position: absolute;
	z-index: 3;
	top: 50%;
	width: 20px;
	height: 20px;
	place-items: center;
	transform: translate(-50%, -50%);
	margin: 0;
	padding: 0;
	overflow: hidden;
	border: 2px solid var(--kol-apes-wave-marker-border, #667168);
	border-radius: 50%;
	background: var(--kol-apes-wave-marker, #fff);
	color: var(--kol-apes-wave-playhead, #315440);
	font-size: 9px;
	font-weight: 800;
	line-height: 1;
	box-shadow: 0 2px 5px rgba(10, 16, 12, 0.18);
	cursor: pointer;
	pointer-events: auto;
	transition: transform 0.15s, border-color 0.15s;
}

.kol-apes-waveform__marker:hover,
.kol-apes-waveform__marker:focus-visible {
	z-index: 5;
	transform: translate(-50%, -50%) scale(1.18);
	border-color: var(--kol-apes-wave-played, #4f765d);
	outline: 0;
}

.kol-apes-waveform__marker img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.kol-apes-waveform.is-loading,
.kol-apes-waveform.is-pending,
.kol-apes-waveform.is-unavailable {
	opacity: 0.72;
}

.kol-apes-waveform.is-loading .kol-apes-waveform__surface::after,
.kol-apes-waveform.is-pending .kol-apes-waveform__surface::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.18) 46%, transparent 66%);
	background-size: 180% 100%;
	pointer-events: none;
	animation: kol-apes-waveform-loading 1.4s linear infinite;
}

.kol-apes-waveform--compact {
	gap: 7px;
	margin-top: 5px;
}

.kol-apes-waveform--compact .kol-apes-waveform__surface {
	height: 32px;
}

.kol-apes-waveform--compact .kol-apes-waveform__time {
	min-width: 34px;
	font-size: 10px;
}

.kol-apes-waveform--compact .kol-apes-waveform__marker {
	top: 50%;
	width: 9px;
	height: 9px;
	border-width: 1px;
	box-shadow: none;
}

.kol-apes-waveform--compact .kol-apes-waveform__marker img {
	display: none;
}

.kol-apes-comment-audio-time,
.kol-apes-comment-at-time {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	min-height: 26px;
	margin: 0;
	padding: 2px 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: var(--kol-apes-panel-accent, #4f765d);
	font: inherit;
	font-size: 12px;
	font-weight: 750;
	line-height: 1;
	box-shadow: none;
	cursor: pointer;
}

.kol-apes-comment-audio-time:hover,
.kol-apes-comment-audio-time:focus-visible {
	border: 0;
	background: transparent;
	color: var(--kol-apes-panel-accent-strong, #315440);
	box-shadow: none;
}

.kol-apes-comment-audio-time .dashicons {
	width: 15px;
	height: 15px;
	font-size: 15px;
}

.kol-apes-comment-at-time {
	position: relative;
	user-select: none;
}

.kol-apes-comment-at-time input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	pointer-events: none;
}

.kol-apes-comment-at-time__box {
	display: grid;
	width: 16px;
	height: 16px;
	place-items: center;
	border: 1px solid currentColor;
	border-radius: 3px;
}

.kol-apes-comment-at-time input:checked + .kol-apes-comment-at-time__box::after {
	content: "";
	width: 8px;
	height: 8px;
	border-radius: 2px;
	background: currentColor;
}

.kol-apes-comment-at-time input:focus-visible + .kol-apes-comment-at-time__box {
	outline: 2px solid var(--kol-apes-panel-accent-soft, rgba(79, 118, 93, 0.25));
	outline-offset: 2px;
}

.kol-apes-comment-at-time.is-disabled {
	opacity: 0.52;
	cursor: default;
}

.kol-apes-comment.is-waveform-target .kol-apes-comment-card {
	box-shadow: 0 0 0 2px var(--kol-apes-panel-accent, #4f765d);
}

@keyframes kol-apes-waveform-loading {
	from { background-position: 180% 0; }
	to { background-position: -80% 0; }
}

@media (max-width: 640px) {
	.kol-apes-waveform {
		gap: 7px;
		margin-top: 5px;
	}

	.kol-apes-waveform__surface {
		height: 42px;
	}

	.kol-apes-waveform__time {
		min-width: 36px;
		font-size: 10px;
	}

	.kol-apes-waveform:not(.kol-apes-waveform--compact) .kol-apes-waveform__time {
		font-size: 0;
	}

	.kol-apes-waveform:not(.kol-apes-waveform--compact) .kol-apes-waveform__time::after {
		content: attr(data-duration-label);
		font-size: 10px;
	}

	.kol-apes-waveform__marker {
		width: 12px;
		height: 12px;
		border-width: 1px;
	}

	.kol-apes-waveform__marker img {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.kol-apes-waveform.is-loading .kol-apes-waveform__surface::after,
	.kol-apes-waveform.is-pending .kol-apes-waveform__surface::after {
		animation: none;
	}
}
