/* assets/css/features/tts.css */
body.wtapp-shell-body.wtapp-reader-mode .wtapp-tts-mode[hidden] {
	display: none;
}

body.wtapp-shell-body.wtapp-reader-mode.wtapp-tts-mode-active .wtapp-reader-view {
	display: none;
}

body.wtapp-shell-body.wtapp-reader-mode.wtapp-tts-mode-active .wtapp-screen--reader {
	padding-bottom: calc(112px + var(--wtapp-safe-bottom));
}

body.wtapp-shell-body.wtapp-reader-mode.wtapp-tts-mode-active .wtapp-tts-mode {
	display: grid;
	gap: 18px;
}

.wtapp-tts-mode__header,
.wtapp-tts-mode__transport-card,
.wtapp-tts-mode__controls-card,
.wtapp-tts-mode__queue-card,
.wtapp-tts-mode__gate {
	background: var(--wtapp-reader-paper);
	color: var(--wtapp-reader-ink);
	border: 1px solid var(--wtapp-reader-line);
	box-shadow: 0 18px 40px rgba(38, 26, 16, 0.08);
	border-radius: 24px;
}

.wtapp-tts-mode__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	padding: 22px 24px;
	position: sticky;
	top: calc(12px + var(--wtapp-safe-top));
	z-index: 26;
}

.wtapp-tts-mode__header-main {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.wtapp-tts-mode__back {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	border: 0;
	padding: 0;
	background: transparent;
	color: var(--wtapp-reader-accent);
	font-size: 0.92rem;
	font-weight: 700;
	cursor: pointer;
}

.wtapp-tts-mode__back::before {
	content: "←";
}

.wtapp-tts-mode__eyebrow {
	margin: 0;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--wtapp-reader-muted);
}

.wtapp-tts-mode__title,
.wtapp-tts-mode__queue-title,
.wtapp-tts-mode__gate-title {
	margin: 0;
	font-family: var(--wtapp-font-display);
	font-size: clamp(1.45rem, 1.9vw, 2.2rem);
	line-height: 1.08;
}

.wtapp-tts-mode__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 14px;
	color: var(--wtapp-reader-muted);
	font-size: 0.92rem;
}

.wtapp-tts-mode__wallet {
	font-weight: 700;
	color: var(--wtapp-reader-accent);
}

.wtapp-tts-mode__transport-card,
.wtapp-tts-mode__controls-card,
.wtapp-tts-mode__queue-card,
.wtapp-tts-mode__gate {
	padding: 20px 22px;
}

.wtapp-tts-mode__transport-head,
.wtapp-tts-mode__queue-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

.wtapp-tts-mode__status,
.wtapp-tts-mode__queue-summary,
.wtapp-tts-mode__gate-copy {
	margin: 0;
	color: var(--wtapp-reader-muted);
}

.wtapp-tts-mode__time {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-variant-numeric: tabular-nums;
	color: var(--wtapp-reader-muted);
}

.wtapp-tts-mode__progress {
	height: 10px;
	border-radius: 999px;
	background: rgba(54, 102, 244, 0.12);
	overflow: hidden;
	margin-top: 14px;
}

.wtapp-tts-mode__progress-bar {
	display: block;
	height: 100%;
	width: 0;
	border-radius: inherit;
	background: linear-gradient(90deg, #b05d17 0%, #df8a28 100%);
	transition: width 180ms ease;
}

.wtapp-tts-mode__transport-actions,
.wtapp-tts-mode__gate-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 16px;
}

.wtapp-tts-mode__controls-card {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
}

.wtapp-tts-mode__control {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.wtapp-tts-mode__control label {
	font-size: 0.82rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wtapp-reader-muted);
}

.wtapp-tts-mode__control select {
	width: 100%;
	padding: 12px 14px;
	border-radius: 16px;
	border: 1px solid var(--wtapp-reader-line);
	background: rgba(255, 255, 255, 0.88);
	color: var(--wtapp-reader-ink);
}

.wtapp-tts-mode__queue-list {
	display: grid;
	gap: 10px;
	margin: 18px 0 0;
	padding: 0;
	list-style: none;
}

.wtapp-tts-mode__queue-item {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 12px 14px;
	border-radius: 16px;
	border: 1px solid var(--wtapp-reader-line);
	background: rgba(255, 255, 255, 0.56);
}

.wtapp-tts-mode__queue-item.is-current {
	border-color: rgba(176, 93, 23, 0.4);
	background: rgba(176, 93, 23, 0.08);
}

.wtapp-tts-mode__queue-label {
	font-size: 0.74rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--wtapp-reader-muted);
}

.wtapp-tts-mode__rail {
	display: none;
}

@media (max-width: 860px) {
	body.wtapp-shell-body.wtapp-reader-mode.wtapp-tts-mode-active .wtapp-screen--reader {
		padding-bottom: calc(120px + var(--wtapp-safe-bottom));
	}

	.wtapp-tts-mode {
		gap: 12px;
	}

	.wtapp-tts-mode__header {
		flex-direction: column;
		padding: 14px 16px;
		top: calc(8px + var(--wtapp-safe-top));
	}

	.wtapp-tts-mode__title {
		font-size: 1.2rem;
		line-height: 1.15;
	}

	.wtapp-tts-mode__transport-head,
	.wtapp-tts-mode__queue-head {
		flex-direction: column;
		align-items: flex-start;
	}

	.wtapp-tts-mode__transport-card,
	.wtapp-tts-mode__controls-card,
	.wtapp-tts-mode__queue-card,
	.wtapp-tts-mode__gate {
		padding: 16px;
		border-radius: 20px;
	}

	.wtapp-tts-mode__controls-card {
		grid-template-columns: 1fr;
	}

	.wtapp-tts-mode__transport-actions {
		display: none;
	}

	.wtapp-tts-mode__history {
		display: none;
	}

	.wtapp-tts-mode__rail {
		position: sticky;
		bottom: calc(12px + var(--wtapp-safe-bottom));
		z-index: 28;
		display: grid;
		grid-template-columns: repeat(4, minmax(0, 1fr));
		gap: 8px;
		padding: 10px;
		border-radius: 20px;
		background: rgba(28, 22, 19, 0.94);
		border: 1px solid rgba(255, 244, 230, 0.14);
		box-shadow: 0 24px 50px rgba(19, 12, 8, 0.28);
	}

	.wtapp-tts-mode__rail .wtapp-button {
		padding: 10px 8px;
		font-size: 0.92rem;
	}

	.wtapp-tts-mode__rail .wtapp-button--ghost {
		color: #fff6ea;
		border-color: rgba(255, 246, 234, 0.18);
	}
}
