.pah-article-header,
.pah-article-header * {
	box-sizing: border-box;
}

.pah-article-header {
	width: 100%;
	padding: 80px 80px 48px;
	background: #fff;
	color: #111;
}

.pah-article-header__inner {
	display: flex;
	width: 100%;
	max-width: 1280px;
	margin: 0 auto;
	flex-direction: column;
	align-items: center;
	gap: 32px;
}

.pah-header-meta {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	max-width: 100%;
	font-family: Outfit, Arial, sans-serif;
}

.pah-category-tag {
	display: inline-flex;
	align-items: center;
	padding: 4px 10px;
	background: rgba(224, 63, 84, 0.08);
	border-radius: 3px;
	color: #e03f54;
	font-size: 10px;
	font-weight: 700;
	line-height: 1.3;
	text-transform: uppercase;
	white-space: nowrap;
}

.pah-meta-dot {
	width: 4px;
	height: 4px;
	flex: 0 0 4px;
	border-radius: 50%;
	background: #e03f54;
}

.pah-updated-date {
	color: #4a4a4a;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.25;
}

.pah-article-title {
	width: 100%;
	max-width: 1000px;
	margin: 0;
	color: #111;
	font-family: Fraunces, Georgia, serif;
	font-size: clamp(2.125rem, 4vw, 3.25rem);
	font-weight: 900;
	line-height: 1.1;
	text-align: center;
	text-wrap: balance;
}

.pah-article-deck {
	width: 100%;
	max-width: 800px;
	margin: 0;
	color: #4a4a4a;
	font-family: Lora, Georgia, serif;
	font-size: 19px;
	font-weight: 400;
	line-height: 1.5;
	text-align: center;
}

.pah-article-deck > :first-child {
	margin-top: 0;
}

.pah-article-deck > :last-child {
	margin-bottom: 0;
}

.pah-author-row {
	display: flex;
	max-width: 100%;
	align-items: center;
	justify-content: center;
	gap: 16px;
	font-family: Outfit, Arial, sans-serif;
}

.pah-author-photo {
	width: 40px;
	height: 40px;
	flex: 0 0 auto;
	border-radius: 50%;
	object-fit: cover;
}

.pah-author-meta-text {
	display: flex;
	min-width: 0;
	flex-direction: column;
	align-items: flex-start;
	gap: 2px;
}

.pah-author-name,
.pah-author-role,
.pah-reading-time {
	display: block;
}

.pah-author-name {
	color: #111;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.25;
}

.pah-author-role {
	color: #888;
	font-size: 11px;
	font-weight: 400;
	line-height: 1.25;
}

.pah-author-separator {
	width: 1px;
	height: 16px;
	flex: 0 0 1px;
	background: #eaeaea;
}

.pah-reading-time {
	color: #888;
	font-size: 13px;
	font-weight: 400;
	line-height: 1.25;
	white-space: nowrap;
}

.pah-article-toolbar {
	display: flex;
	width: 100%;
	max-width: 1280px;
	min-height: 60px;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	padding: 16px 24px;
	border-width: 1px 0;
	border-style: solid;
	border-color: #111;
	font-family: Outfit, Arial, sans-serif;
}

.pah-audio-player {
	--pah-progress: 0%;
	--pah-progress-bg: #eaeaea;
	--pah-progress-active: #111;
	display: flex;
	min-width: 0;
	align-items: center;
	gap: 12px;
}

.pah-play-btn,
.pah-speed-badge,
.pah-ai-button {
	-webkit-appearance: none;
	appearance: none;
	font: inherit;
}

.pah-play-btn {
	display: inline-flex;
	width: 28px;
	height: 28px;
	flex: 0 0 28px;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #111;
	color: #fff;
	cursor: pointer;
}

.pah-play-btn:disabled,
.pah-speed-badge:disabled,
.pah-ai-button:disabled {
	cursor: not-allowed;
	opacity: 0.45;
}

.pah-play-btn:focus-visible,
.pah-speed-badge:focus-visible,
.pah-ai-button:focus-visible,
.pah-progress-range:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

.pah-icon {
	width: 12px;
	height: 12px;
}

.pah-icon-pause {
	display: none;
}

.pah-audio-player.is-playing .pah-icon-play {
	display: none;
}

.pah-audio-player.is-playing .pah-icon-pause {
	display: block;
}

.pah-audio-label {
	color: #111;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.25;
	white-space: nowrap;
}

.pah-progress-container {
	display: flex;
	min-width: 0;
	align-items: center;
	gap: 8px;
}

.pah-progress-range {
	width: 160px;
	height: 4px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 2px;
	background: linear-gradient(to right, var(--pah-progress-active) 0 var(--pah-progress), var(--pah-progress-bg) var(--pah-progress) 100%);
	cursor: pointer;
}

.pah-progress-range::-webkit-slider-runnable-track {
	height: 4px;
	border-radius: 2px;
	background: transparent;
}

.pah-progress-range::-moz-range-track {
	height: 4px;
	border-radius: 2px;
	background: transparent;
}

.pah-progress-range::-webkit-slider-thumb {
	width: 12px;
	height: 12px;
	margin-top: -4px;
	border: 0;
	border-radius: 50%;
	background: var(--pah-progress-active);
	opacity: 0;
	-webkit-appearance: none;
}

.pah-progress-range::-moz-range-thumb {
	width: 12px;
	height: 12px;
	border: 0;
	border-radius: 50%;
	background: var(--pah-progress-active);
	opacity: 0;
}

.pah-progress-range:hover::-webkit-slider-thumb,
.pah-progress-range:focus-visible::-webkit-slider-thumb,
.pah-progress-range:hover::-moz-range-thumb,
.pah-progress-range:focus-visible::-moz-range-thumb {
	opacity: 1;
}

.pah-audio-time {
	min-width: 32px;
	color: #888;
	font-size: 12px;
	font-weight: 400;
	line-height: 1.25;
	white-space: nowrap;
}

.pah-speed-badge {
	display: inline-flex;
	min-width: 27px;
	height: 20px;
	align-items: center;
	justify-content: center;
	padding: 3px 7px;
	border: 1px solid #eaeaea;
	border-radius: 4px;
	background: #f7f4f0;
	color: #111;
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
}

.pah-ai-summary {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: flex-end;
	gap: 12px;
}

.pah-ai-summary-label {
	color: #4a4a4a;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.25;
	text-transform: uppercase;
	white-space: nowrap;
}

.pah-ai-brand-buttons {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	flex-wrap: nowrap;
	gap: 6px;
}

.pah-ai-button {
	display: inline-flex;
	min-height: 30px;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 5px 9px;
	border: 1px solid rgba(17, 17, 17, 0.14);
	border-radius: 999px;
	background: #fff;
	color: #111;
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.pah-ai-button:hover,
.pah-ai-button:focus-visible {
	border-color: rgba(17, 17, 17, 0.28);
	background: #f7f4f0;
	color: #111;
	text-decoration: none;
	transform: translateY(-1px);
}

.pah-ai-button-mark {
	display: inline-flex;
	width: 15px;
	height: 15px;
	align-items: center;
	justify-content: center;
	font-size: 13px;
	font-weight: 700;
	line-height: 1;
}

.pah-ai-button-name {
	display: inline-block;
}

@media (max-width: 1280px) {
	.pah-article-header {
		padding-right: 32px !important;
		padding-left: 32px !important;
	}
}

@media (max-width: 1024px) {
	.pah-article-toolbar {
		flex-wrap: wrap;
	}

	.pah-audio-player {
		flex: 1 1 420px;
	}

	.pah-ai-summary {
		margin-left: auto;
	}
}

@media (max-width: 767px) {
	.pah-article-header {
		padding: 40px 20px 32px !important;
	}

	.pah-article-toolbar {
		padding-right: 16px !important;
		padding-left: 16px !important;
	}

	.pah-ai-brand-buttons {
		width: 100%;
		max-width: 100%;
		overflow-x: auto;
		overflow-y: hidden;
		justify-content: flex-start;
		-webkit-overflow-scrolling: touch;
	}

	.pah-header-meta {
		flex-wrap: wrap;
	}

	.pah-article-deck {
		font-size: 17px;
	}

	.pah-author-row {
		flex-wrap: wrap;
		text-align: left;
	}

	.pah-author-separator {
		display: none;
	}

	.pah-reading-time {
		width: 100%;
		padding-left: 56px;
	}

	.pah-article-toolbar {
		align-items: stretch;
		flex-direction: column;
		gap: 16px;
	}

	.pah-audio-player {
		width: 100%;
		flex: 0 1 auto;
		flex-wrap: wrap;
	}

	.pah-progress-container {
		min-width: 150px;
		flex: 1 1 160px;
	}

	.pah-progress-range {
		width: 100%;
	}

	.pah-ai-summary {
		width: 100%;
		justify-content: space-between;
		margin-left: 0;
	}
}

@media (max-width: 480px) {
	.pah-header-meta {
		row-gap: 8px;
	}

	.pah-meta-dot {
		display: none;
	}

	.pah-updated-date {
		width: 100%;
		text-align: center;
	}

	.pah-audio-label {
		flex: 1 1 calc(100% - 44px);
	}

	.pah-progress-container {
		width: calc(100% - 44px);
		flex-basis: calc(100% - 44px);
		margin-left: 40px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.pah-ai-button {
		transition: none;
	}
}

/* External AI summary service selector. */
@media (max-width: 640px) {
	.pah-ai-summary {
		align-items: flex-start;
		flex-direction: column;
	}

	.pah-ai-brand-buttons {
		justify-content: flex-start;
	}
}

.pah-audio-player.is-loading .pah-play-btn,
.pah-audio-player.is-loading .pah-speed-badge {
	cursor: wait;
	opacity: 0.55;
}

.pah-audio-player.is-loading .pah-audio-label::after {
	content: "";
	display: inline-block;
	width: 0.8em;
	height: 0.8em;
	margin-left: 0.55em;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	vertical-align: -0.1em;
	animation: beautifultech-audio-spin 0.8s linear infinite;
}

.pah-audio-player.is-error .pah-audio-label {
	color: #b42318;
	white-space: normal;
}

.pah-play-btn:disabled,
.pah-speed-badge:disabled,
.pah-progress-range:disabled {
	cursor: not-allowed;
	opacity: 0.45;
}

@keyframes beautifultech-audio-spin {
	to { transform: rotate(360deg); }
}

/* Mobile audio and AI toolbar: ordered, compact two-block layout. */
@media (max-width: 767px) {
	.pah-article-toolbar {
		gap: 20px;
		padding: 16px !important;
	}

	.pah-audio-player {
		display: grid;
		grid-template-columns: 28px minmax(0, 1fr) auto;
		grid-template-areas:
			"play label speed"
			". progress progress";
		width: 100%;
		align-items: center;
		column-gap: 12px;
		row-gap: 10px;
	}

	.pah-play-btn {
		grid-area: play;
	}

	.pah-audio-label {
		grid-area: label;
		min-width: 0;
		white-space: normal;
	}

	.pah-speed-badge {
		grid-area: speed;
		margin: 0;
	}

	.pah-progress-container {
		grid-area: progress;
		display: grid;
		grid-template-columns: minmax(0, 1fr) auto;
		width: 100%;
		min-width: 0;
		margin: 0;
		gap: 8px;
	}

	.pah-progress-range {
		width: 100%;
		min-width: 0;
	}

	.pah-audio-time:empty {
		display: none;
	}

	.pah-ai-summary {
		display: flex;
		width: 100%;
		align-items: stretch;
		flex-direction: column;
		justify-content: flex-start;
		gap: 10px;
		margin-left: 0;
	}

	.pah-ai-summary-label {
		font-size: 11px;
		white-space: normal;
	}

	.pah-ai-brand-buttons {
		display: flex;
		width: 100%;
		max-width: none;
		align-items: center;
		justify-content: space-between;
		flex-wrap: nowrap;
		gap: 4px;
		overflow: visible;
	}

	.pah-ai-button {
		min-width: 0;
		min-height: 28px;
		flex: 0 1 auto;
		gap: 3px;
		padding: 4px 5px;
		font-size: 9px;
	}

	.pah-ai-button-mark {
		width: 11px;
		height: 11px;
		flex: 0 0 11px;
		font-size: 10px;
	}
}

@media (max-width: 340px) {
	.pah-article-toolbar {
		padding-right: 12px !important;
		padding-left: 12px !important;
	}

	.pah-ai-brand-buttons {
		gap: 3px;
	}

	.pah-ai-button {
		gap: 2px;
		padding-right: 4px;
		padding-left: 4px;
		font-size: 8.5px;
	}
}
