/* ReaderRelay mini player */

/* Follow-along: the verse being read gets the reader's own hover look,
   so it stays theme-aware (light/dark) without new colors. */
.lrw-verse.rrp-reading {
	background: var( --lrw-bg-alt );
}

.rrp {
	--rrp-bg: #ffffff;
	--rrp-ink: #1f2328;
	--rrp-muted: #6b7280;
	--rrp-line: #e5e3de;
	--rrp-accent: #a4262c;
	--rrp-radius: 14px;
	--rrp-shadow: 0 10px 32px rgba( 15, 18, 22, 0.18 );
	position: fixed;
	z-index: 99999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 14px;
	line-height: 1.4;
	color: var( --rrp-ink );
}

/* Flatsome puts margin on every <button>; zero it inside the player only.
   :where() keeps specificity flat so our own rules still win. */
.rrp :where( button, .button, input[type='submit'] ) {
	margin: 0;
}

.rrp-bottom-right { right: 18px; bottom: 18px; }
.rrp-bottom-left { left: 18px; bottom: 18px; }
.rrp-top-right { right: 18px; top: 18px; }
.rrp-top-left { left: 18px; top: 18px; }

.rrp [hidden] {
	display: none !important;
}

/* Launcher pill */

.rrp-launcher {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 16px;
	border: 0;
	border-radius: 999px;
	background: var( --rrp-accent );
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	box-shadow: var( --rrp-shadow );
}

.rrp-launcher:hover {
	filter: brightness( 1.08 );
}

/* Panel */

.rrp-panel {
	width: 340px;
	max-width: calc( 100vw - 24px );
	background: var( --rrp-bg );
	border: 1px solid var( --rrp-line );
	border-radius: var( --rrp-radius );
	box-shadow: var( --rrp-shadow );
	padding: 14px 16px 12px;
}

.rrp-head {
	display: flex;
	align-items: flex-start;
	gap: 6px;
}

.rrp-head-text {
	flex: 1;
	min-width: 0;
}

.rrp-title {
	font-weight: 700;
	font-size: 15px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.rrp-part {
	color: var( --rrp-muted );
	font-size: 12px;
	margin-top: 1px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.rrp-status {
	margin: 8px 0 0;
	padding: 8px 10px;
	border-radius: 8px;
	background: #f6f5f2;
	color: var( --rrp-muted );
	font-size: 12.5px;
}

.rrp-status a {
	color: var( --rrp-accent );
	text-decoration: underline;
}

.rrp-spin::before {
	content: '';
	display: inline-block;
	width: 10px;
	height: 10px;
	margin-right: 7px;
	border: 2px solid var( --rrp-line );
	border-top-color: var( --rrp-accent );
	border-radius: 50%;
	animation: rrp-rotate 0.9s linear infinite;
	vertical-align: -1px;
}

@keyframes rrp-rotate {
	to { transform: rotate( 360deg ); }
}

/* Seek */

.rrp-seek-row {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 10px;
}

.rrp-time {
	color: var( --rrp-muted );
	font-size: 11px;
	font-variant-numeric: tabular-nums;
	min-width: 30px;
	text-align: center;
}

.rrp-seek {
	flex: 1;
	-webkit-appearance: none;
	appearance: none;
	height: 4px;
	border-radius: 2px;
	background: var( --rrp-line );
	outline: none;
	cursor: pointer;
}

.rrp-seek::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	border: 0;
	background: var( --rrp-accent );
	cursor: pointer;
}

.rrp-seek::-moz-range-thumb {
	width: 14px;
	height: 14px;
	border-radius: 50%;
	border: 0;
	background: var( --rrp-accent );
	cursor: pointer;
}

/* Controls */

.rrp-controls {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
	margin-top: 8px;
}

.rrp-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var( --rrp-ink );
	cursor: pointer;
}

.rrp-btn:hover {
	background: #f1efe9;
}

.rrp-play {
	width: 46px;
	height: 46px;
	background: var( --rrp-accent );
	color: #fff;
}

.rrp-play:hover {
	background: var( --rrp-accent );
	filter: brightness( 1.08 );
}

.rrp-speed {
	width: auto;
	min-width: 40px;
	border-radius: 999px;
	padding: 0 8px;
	font-size: 12px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

/* Footer */

.rrp-foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 4px 10px;
	margin-top: 10px;
	padding-top: 9px;
	border-top: 1px solid var( --rrp-line );
}

.rrp-continuous {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var( --rrp-muted );
	font-size: 12px;
	cursor: pointer;
	margin: 0;
}

.rrp-continuous input {
	margin: 0;
	accent-color: var( --rrp-accent );
}

.rrp-download-all,
.rrp-chapter-link {
	color: var( --rrp-accent );
	font-size: 12px;
	text-decoration: underline;
	cursor: pointer;
}

/* Settings modal */

.rrp-modal {
	position: fixed;
	inset: 0;
	background: rgba( 15, 18, 22, 0.45 );
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 100000;
	padding: 16px;
}

.rrp-modal-card {
	width: 360px;
	max-width: 100%;
	max-height: 85vh;
	overflow: auto;
	background: var( --rrp-bg );
	border-radius: var( --rrp-radius );
	box-shadow: var( --rrp-shadow );
	padding: 16px 18px 18px;
}

.rrp-modal-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 6px;
}

.rrp-label {
	display: block;
	margin: 12px 0 4px;
	font-size: 12px;
	font-weight: 700;
	color: var( --rrp-muted );
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.rrp-modal-card .rrp-field {
	width: 100%;
	height: 38px;
	padding: 0 10px;
	border: 1px solid var( --rrp-line );
	border-radius: 8px;
	background: #fff;
	color: var( --rrp-ink );
	font-size: 14px;
	box-shadow: none;
	margin: 0;
}

.rrp-voice-row {
	display: flex;
	gap: 8px;
}

.rrp-voice-row select {
	flex: 1;
	min-width: 0;
}

.rrp-hint {
	margin: 6px 0 0;
	font-size: 12px;
	color: var( --rrp-muted );
}

.rrp-hint a {
	color: var( --rrp-accent );
	text-decoration: underline;
}

.rrp-message:not( :empty ) {
	margin-top: 10px;
	color: var( --rrp-ink );
}

.rrp-share {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin: 14px 0 0;
	font-size: 13px;
	cursor: pointer;
}

.rrp-share input {
	margin: 3px 0 0;
	accent-color: var( --rrp-accent );
}

.rrp-primary,
.rrp-secondary {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 38px;
	padding: 0 18px;
	border-radius: 8px;
	border: 0;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
}

.rrp-primary {
	background: var( --rrp-accent );
	color: #fff;
	margin-top: 12px;
}

.rrp-secondary {
	background: #f1efe9;
	color: var( --rrp-ink );
	white-space: nowrap;
}

/* Phones: the panel becomes a full-width bottom bar */

@media ( max-width: 600px ) {
	.rrp-bottom-right,
	.rrp-bottom-left {
		left: 0;
		right: 0;
		bottom: 0;
	}

	.rrp-bottom-right .rrp-panel,
	.rrp-bottom-left .rrp-panel {
		width: 100%;
		max-width: none;
		border-radius: 16px 16px 0 0;
		border-left: 0;
		border-right: 0;
		border-bottom: 0;
		padding-bottom: calc( 10px + env( safe-area-inset-bottom, 0px ) );
	}

	.rrp-bottom-right .rrp-launcher,
	.rrp-bottom-left .rrp-launcher {
		position: fixed;
		right: 16px;
		bottom: calc( 16px + env( safe-area-inset-bottom, 0px ) );
	}
}

/* The Lil Red Wagon reader parks its own action bar along the bottom on
   phones — sit the player just above it instead of covering it. */
@media ( max-width: 782px ) {
	body:has( .lrw-app ) .rrp-bottom-right,
	body:has( .lrw-app ) .rrp-bottom-left {
		bottom: calc( 57px + env( safe-area-inset-bottom, 0px ) );
	}

	body:has( .lrw-app ) .rrp-bottom-right .rrp-launcher,
	body:has( .lrw-app ) .rrp-bottom-left .rrp-launcher {
		bottom: calc( 73px + env( safe-area-inset-bottom, 0px ) );
	}
}
