/* Mobile and tablet chrome. Display is gated only by viewport, never by an OS class. */

:root {
	--ap-header-h: calc(52px + env(safe-area-inset-top, 0px));
	--ap-tabbar-h: calc(56px + env(safe-area-inset-bottom, 0px));
	--ap-player-h: 0px;
	--ap-adminbar-h: 0px;
	--ap-safe-top: env(safe-area-inset-top, 0px);
	--ap-safe-bottom: env(safe-area-inset-bottom, 0px);
	--ap-chrome-bottom: var(--ap-tabbar-h);
	--ap-keyboard-inset: 0px;
	--ap-page: #121212;
	--ap-text: #f6f6f6;
	--ap-muted: #aaaead;
	--ap-action: #1ed760;
	--ap-on-action: #0d2114;
	--ap-line: #303030;
	--ap-focus: #b7f8cf;
}

body.admin-bar {
	--ap-adminbar-h: 46px;
}

@media (min-width: 783px) {
	body.admin-bar {
		--ap-adminbar-h: 32px;
	}
}

.ap-chrome,
.ap-tabbar,
.ap-sheet,
.ap-sheet-backdrop {
	display: none;
}

.ap-icon {
	width: 24px;
	height: 24px;
	display: block;
	flex: 0 0 auto;
}

.ap-chrome__logo {
	display: block;
	height: 28px;
	width: auto;
	max-width: 132px;
	object-fit: contain;
}

.ap-chrome__logo-text {
	font-weight: 700;
	font-size: 16px;
	color: var(--ap-text);
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

@media (max-width: 980px) {
	.ap-chrome {
		display: grid;
		position: fixed;
		z-index: 100070;
		top: var(--ap-adminbar-h);
		left: 0;
		right: 0;
		grid-template-columns: minmax(48px, auto) minmax(0, 1fr) minmax(48px, auto);
		align-items: center;
		gap: 4px;
		min-height: var(--ap-header-h);
		padding: var(--ap-safe-top) 8px 0;
		background: var(--ap-page);
		color: var(--ap-text);
		box-sizing: border-box;
		font-family: system-ui, sans-serif;
	}

	html.ap-ios .ap-chrome {
		font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", system-ui, sans-serif;
	}

	html.ap-android .ap-chrome,
	html.ap-android .ap-tabbar,
	html.ap-android .ap-sheet {
		font-family: Roboto, "Noto Sans", system-ui, sans-serif;
	}

	.ap-chrome__title {
		min-width: 0;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
		text-align: center;
		font-size: 17px;
		font-weight: 600;
		line-height: 22px;
	}

	html.ap-android .ap-chrome__title {
		text-align: left;
		padding-left: 4px;
	}

	.ap-chrome__leading,
	.ap-chrome__trailing {
		display: flex;
		align-items: center;
		min-height: 48px;
	}

	.ap-chrome__trailing {
		justify-content: flex-end;
	}

	.ap-chrome__back,
	.ap-chrome__close,
	body .ap-chrome button.ap-chrome__icon,
	.ap-chrome__brand {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		min-width: 48px;
		min-height: 48px;
		padding: 0 8px;
		border: 0 !important;
		border-radius: 12px !important;
		background: transparent !important;
		box-shadow: none !important;
		color: var(--ap-text) !important;
		text-decoration: none;
		font: inherit;
		cursor: pointer;
	}

	.ap-chrome__back .ap-icon:first-child,
	.ap-chrome__back-label {
		display: none;
	}

	.ap-chrome__back .ap-icon:nth-of-type(2) {
		display: block;
	}

	html.ap-ios .ap-chrome__back .ap-icon:first-child,
	html.ap-ios .ap-chrome__back-label {
		display: inline-flex;
	}

	html.ap-ios .ap-chrome__back .ap-icon:nth-of-type(2) {
		display: none;
	}

	.ap-chrome__back-label {
		max-width: 88px;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
		color: var(--ap-action);
		font-size: 15px;
	}

	html.ap-ios .ap-chrome__back {
		color: var(--ap-action);
		justify-content: flex-start;
		padding-left: 2px;
	}

	.ap-tabbar {
		display: flex;
		position: fixed;
		z-index: 100060;
		left: 0;
		right: 0;
		bottom: 0;
		justify-content: space-around;
		align-items: stretch;
		min-height: var(--ap-tabbar-h);
		padding: 4px 8px var(--ap-safe-bottom);
		box-sizing: border-box;
		background: rgba(18, 18, 18, 0.94);
		border-top: 1px solid var(--ap-line);
		color: var(--ap-muted);
	}

	html.ap-ios .ap-tabbar {
		background: rgba(18, 18, 18, 0.86);
		-webkit-backdrop-filter: blur(16px);
		backdrop-filter: blur(16px);
	}

	.ap-tabbar__item {
		position: relative;
		display: flex;
		flex: 1 1 0;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 2px;
		min-width: 48px;
		min-height: 48px;
		padding: 4px 2px;
		color: inherit;
		text-decoration: none;
		font-size: 11px;
		font-weight: 600;
		line-height: 13px;
		overflow: hidden;
	}

	.ap-tabbar__item[aria-current="page"] {
		color: var(--ap-action);
	}

	html.ap-android .ap-tabbar__item[aria-current="page"]::before {
		content: "";
		position: absolute;
		top: 2px;
		width: 32px;
		height: 3px;
		border-radius: 3px;
		background: var(--ap-action);
	}

	html.ap-ios .ap-tabbar__item:active,
	html.ap-neutral .ap-tabbar__item:active,
	html.ap-ios .ap-chrome__icon:active,
	html.ap-neutral .ap-chrome__icon:active,
	html.ap-ios .ap-chrome__back:active,
	html.ap-neutral .ap-chrome__back:active {
		opacity: 0.55;
	}

	html.ap-android .ap-tabbar__item:active::after,
	html.ap-android .ap-chrome__icon:active::after {
		content: "";
		position: absolute;
		inset: 4px;
		border-radius: 12px;
		background: rgba(30, 215, 96, 0.18);
	}

	.ap-chrome a:focus-visible,
	.ap-chrome button:focus-visible,
	.ap-tabbar a:focus-visible,
	.ap-sheet a:focus-visible,
	.ap-sheet button:focus-visible {
		outline: 2px solid var(--ap-focus);
		outline-offset: 3px;
	}

	html.ap-scroll-lock,
	html.ap-scroll-lock body {
		overflow: hidden;
	}

	body.ap-has-chrome {
		padding-top: var(--ap-header-h) !important;
		padding-bottom: var(--ap-tabbar-h);
	}

	body.ap-has-chrome.bb-buddypanel,
	body.ap-has-chrome.buddypanel-open,
	body.bb-buddypanel.ap-has-chrome #page {
		margin-left: 0 !important;
		padding-left: 0 !important;
	}

	body.ap-has-chrome .site-header,
	body.ap-has-chrome .bb-mobile-header,
	body.ap-has-chrome #buddypanel,
	body.ap-has-chrome .buddypanel,
	body.ap-has-chrome .buddypanel-menu,
	body.ap-has-chrome .buddypanel-overlay,
	body.ap-has-chrome .bb-mobile-panel-wrapper,
	body.ap-has-chrome .afterpoddy-breadcrumb {
		display: none !important;
	}

	body.ap-chrome-owns-title .afterpoddy-podcast-hero__title,
	body.ap-chrome-owns-title .afterpoddy-episode-discuss-header h1,
	body.ap-chrome-owns-title.afterpoddy-podcast-detail h1.elementor-heading-title,
	body.ap-chrome-owns-title.afterpoddy-episode-view h1.elementor-heading-title,
	body.ap-chrome-owns-title.afterpoddy-episode-screen h1.elementor-heading-title {
		position: absolute !important;
		width: 1px !important;
		height: 1px !important;
		padding: 0 !important;
		margin: -1px !important;
		overflow: hidden !important;
		clip: rect(0, 0, 0, 0) !important;
		white-space: nowrap !important;
		border: 0 !important;
	}

	.ap-sheet[hidden],
	.ap-sheet-backdrop[hidden] {
		display: none !important;
	}

	.ap-sheet:not([hidden]) {
		display: block;
		position: fixed;
		z-index: 100080;
		left: 0;
		right: 0;
		bottom: var(--ap-keyboard-inset);
		max-height: min(85dvh, calc(100svh - var(--ap-header-h) - 12px));
	}

	.ap-sheet__panel {
		display: flex;
		flex-direction: column;
		max-height: inherit;
		overflow: auto;
		background: #1c1c1c;
		color: var(--ap-text);
		border-radius: 16px 16px 0 0;
		padding: 8px 16px calc(16px + var(--ap-safe-bottom));
		box-shadow: 0 -12px 32px rgba(0, 0, 0, 0.45);
		animation: ap-sheet-in 200ms ease;
	}

	.ap-sheet__bar {
		display: flex;
		align-items: center;
		justify-content: space-between;
		min-height: 44px;
	}

	.ap-sheet__grab {
		width: 36px;
		height: 4px;
		margin-left: 8px;
		border-radius: 4px;
		background: #797e7b;
	}

	.ap-sheet-backdrop:not([hidden]) {
		display: block;
		position: fixed;
		z-index: 100075;
		inset: 0;
		background: rgba(0, 0, 0, 0.45);
	}

	.ap-sheet__form,
	.ap-sheet__list {
		display: flex;
		flex-direction: column;
		gap: 8px;
		margin: 8px 0 0;
		padding: 0;
		list-style: none;
	}

	.ap-sheet__label {
		font-size: 14px;
		color: var(--ap-muted);
	}

	.ap-sheet__input {
		min-height: 48px;
		padding: 12px 14px;
		border: 1px solid #797e7b;
		border-radius: 12px;
		background: #121212;
		color: var(--ap-text);
		font-size: 16px;
	}

	.ap-sheet__submit,
	.ap-sheet__action,
	.ap-sheet__list a {
		display: flex;
		align-items: center;
		min-height: 48px;
		padding: 12px 4px;
		border: 0;
		border-bottom: 1px solid var(--ap-line);
		background: transparent;
		color: var(--ap-text);
		font: inherit;
		font-size: 16px;
		text-align: left;
		text-decoration: none;
		cursor: pointer;
	}

	.ap-sheet__submit {
		justify-content: center;
		border: 0;
		border-radius: 100px;
		background: var(--ap-action);
		color: var(--ap-on-action);
		font-weight: 700;
	}

	.ap-sheet__note {
		margin: 12px 0 0;
		color: var(--ap-muted);
		font-size: 13px;
		line-height: 18px;
	}

	.ap-sheet__action[aria-checked="false"] {
		color: var(--ap-muted);
	}

	html.ap-keyboard .ap-tabbar,
	html.ap-composer-open .ap-tabbar,
	html.ap-sheet-open .ap-tabbar {
		display: none !important;
	}

	html.ap-keyboard .afterpoddy-sticky-player {
		visibility: hidden;
	}

	.float-btn__wrapper.float-btn--bottom-right,
	.kodee-fab,
	#chatbot-float-box {
		bottom: calc(var(--ap-tabbar-h) + 12px) !important;
	}

	body.afterpoddy-episode-view {
		--ap-player-h: 74px;
	}

	.afterpoddy-sticky-player {
		bottom: var(--ap-tabbar-h);
		z-index: 100040;
	}

	body.afterpoddy-episode-view #page,
	body.afterpoddy-episode-view .site-content,
	body.afterpoddy-episode-view .afterpoddy-catalog-route {
		padding-bottom: calc(var(--ap-player-h) + 24px);
	}

	.afterpoddy-podcast-tabs,
	.afterpoddy-episode-tabs {
		flex-wrap: nowrap;
		overflow-x: auto;
		scrollbar-width: none;
	}

	.afterpoddy-composer[open] > .afterpoddy-composer-panel {
		position: fixed;
		z-index: 100085;
		left: 0;
		right: 0;
		bottom: var(--ap-keyboard-inset);
		max-height: min(85dvh, calc(100svh - var(--ap-header-h) - 8px));
		overflow: auto;
		background: #1c1c1c;
		color: var(--ap-text);
		border-radius: 16px 16px 0 0;
		padding: 16px 16px calc(16px + var(--ap-safe-bottom));
		box-shadow: 0 -12px 32px rgba(0, 0, 0, 0.45);
		animation: ap-sheet-in 200ms ease;
	}

	.bp-feedback,
	#site-notice,
	.bb-template-notice {
		margin-bottom: 12px;
	}
}

@media (min-width: 700px) and (max-width: 980px) {
	.ap-sheet:not([hidden]) {
		left: 50%;
		right: auto;
		width: min(560px, calc(100% - 48px));
		bottom: calc(var(--ap-tabbar-h) + 16px + var(--ap-keyboard-inset));
		transform: translateX(-50%);
	}

	.ap-sheet__panel,
	.afterpoddy-composer[open] > .afterpoddy-composer-panel {
		border-radius: 16px;
	}

	.ap-tabbar__item {
		font-size: 12px;
	}
}

@keyframes ap-sheet-in {
	from {
		transform: translateY(16px);
		opacity: 0.6;
	}
	to {
		transform: translateY(0);
		opacity: 1;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ap-sheet__panel,
	.afterpoddy-composer[open] > .afterpoddy-composer-panel,
	.ap-tabbar__item,
	.ap-chrome__icon {
		animation: none !important;
		transition: none !important;
	}
}
