/*
 * Pendargah public colour modes.
 * Structure, spacing, imagery and the approved footer layout remain unchanged.
 */
:root {
	color-scheme: light;
	--pg-bg: #f7fbfb;
	--pg-surface: #ffffff;
	--pg-surface-raised: #f2f8f9;
	--pg-surface-soft: #e9f6f4;
	--pg-text: #123a3e;
	--pg-text-muted: #587377;
	--pg-border: #d6e7e9;
	--pg-primary: #008080;
	--pg-primary-hover: #006b6b;
	--pg-on-primary: #ffffff;
	--pg-focus: #006f72;
	--pg-success: #17865d;
	--pg-warning: #d4a04f;
	--pg-danger: #e47b72;
	--pg-theme-shadow: 0 18px 48px rgba(0, 80, 86, .1);
	--pg-theme-shadow-sm: 0 8px 24px rgba(0, 80, 86, .07);
}

html[data-theme="dark"] {
	color-scheme: dark;
	--pg-bg: #061c1e;
	--pg-surface: #0b292c;
	--pg-surface-raised: #103438;
	--pg-surface-soft: #123d40;
	--pg-text: #eaf7f6;
	--pg-text-muted: #b5ccca;
	--pg-border: #568386;
	--pg-primary: #19bfc1;
	--pg-primary-hover: #35dadd;
	--pg-on-primary: #031a1c;
	--pg-focus: #00ffff;
	--pg-success: #71d6ae;
	--pg-warning: #f0c979;
	--pg-danger: #ffaaa3;
	--pg-theme-shadow: 0 22px 58px rgba(0, 0, 0, .34);
	--pg-theme-shadow-sm: 0 10px 28px rgba(0, 0, 0, .24);
	/* Existing public modules share these legacy aliases. */
	--ink: var(--pg-text);
	--muted: var(--pg-text-muted);
	--ice: var(--pg-surface);
	--ice-2: var(--pg-surface-raised);
	--soft: var(--pg-surface-soft);
	--white: var(--pg-surface);
	--line: var(--pg-border);
	--shadow: var(--pg-theme-shadow);
	--shadow-sm: var(--pg-theme-shadow-sm);
	--shadow2: var(--pg-theme-shadow-sm);
	--shadow-md: var(--pg-theme-shadow);
	--pg-ice: var(--pg-surface-raised);
	--pg-line: var(--pg-border);
	--pg-muted: var(--pg-text-muted);
	--pg-shadow: var(--pg-theme-shadow);
	--pg-shadow-sm: var(--pg-theme-shadow-sm);
}

html[data-theme="dark"] body {
	background: var(--pg-bg);
	color: var(--pg-text);
}

html[data-theme="dark"] :is(input, select, textarea) {
	color-scheme: dark;
}

html[data-theme="dark"] :is(a, button, input, select, textarea, summary):focus-visible {
	outline-color: var(--pg-focus);
}

/* Header mode control */
.pandargah-theme-control {
	position: relative;
	flex: 0 0 auto;
}

.pandargah-theme-sr {
	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;
}

.pandargah-theme-toggle {
	position: relative;
	width: 44px;
	height: 44px;
}

.pandargah-theme-toggle svg {
	position: absolute;
	transition: opacity .16s ease, transform .16s ease;
}

.pandargah-theme-toggle .pandargah-theme-sun,
.pandargah-theme-toggle[data-effective-theme="dark"] .pandargah-theme-moon {
	opacity: 1;
	transform: scale(1) rotate(0);
}

.pandargah-theme-toggle .pandargah-theme-moon,
.pandargah-theme-toggle[data-effective-theme="dark"] .pandargah-theme-sun {
	opacity: 0;
	transform: scale(.65) rotate(-28deg);
}

.pandargah-theme-menu {
	position: absolute;
	z-index: 180;
	top: calc(100% + 10px);
	inset-inline-end: 0;
	width: 176px;
	padding: 7px;
	border: 1px solid var(--pg-border);
	border-radius: 15px;
	background: var(--pg-surface);
	box-shadow: var(--pg-theme-shadow);
	direction: rtl;
}

.pandargah-theme-menu[hidden] {
	display: none !important;
}

.pandargah-theme-choice {
	width: 100%;
	min-height: 44px;
	padding: 9px 10px;
	display: flex;
	align-items: center;
	gap: 9px;
	border: 0 !important;
	border-radius: 10px !important;
	color: var(--pg-text) !important;
	background: transparent !important;
	font: inherit;
	font-size: .78rem;
	font-weight: 700;
	text-align: right;
}

.pandargah-theme-choice svg {
	width: 18px;
	height: 18px;
	color: var(--pg-primary);
}

.pandargah-theme-choice:hover,
.pandargah-theme-choice:focus-visible {
	background: var(--pg-surface-raised) !important;
}

.pandargah-theme-choice.is-selected {
	color: var(--pg-primary-hover) !important;
	background: var(--pg-surface-soft) !important;
}

.pandargah-theme-choice.is-selected::after {
	content: "✓";
	margin-inline-start: auto;
	color: var(--pg-primary);
	font-weight: 900;
}

/* Shared header. The footer is intentionally not structurally restyled. */
html[data-theme="dark"] .pandargah-mainbar {
	border-bottom-color: var(--pg-border);
	background: rgba(6, 28, 30, .94);
	box-shadow: 0 5px 22px rgba(0, 0, 0, .24);
}

html[data-theme="dark"] :is(.pandargah-brand-copy strong, .pandargah-nav-link, .pandargah-products-trigger) {
	color: var(--pg-text);
}

html[data-theme="dark"] :is(
	.pandargah-nav-link:hover,
	.pandargah-nav-link:focus,
	.pandargah-products-trigger:hover,
	.pandargah-products-trigger:focus,
	.pandargah-products-trigger[aria-expanded="true"],
	.pandargah-nav-link[aria-current="page"]
) {
	color: #8ff6f3 !important;
	background: var(--pg-surface-raised) !important;
}

html[data-theme="dark"] :is(
	.pandargah-mega,
	.pandargah-search-panel,
	.pandargah-mobile-drawer
) {
	color: var(--pg-text);
	border-color: var(--pg-border);
	background: var(--pg-surface);
	box-shadow: var(--pg-theme-shadow);
}

html[data-theme="dark"] .pandargah-mega-card {
	border-color: var(--pg-border);
	background: linear-gradient(145deg, var(--pg-surface-raised), var(--pg-surface) 72%);
}

html[data-theme="dark"] :is(.pandargah-mega-card strong, .pandargah-mega-card > span, .pandargah-quick-links a) {
	color: var(--pg-text);
}

html[data-theme="dark"] :is(
	.pandargah-icon-btn,
	.pandargah-account-link,
	.pandargah-search-field,
	.pandargah-drawer-search,
	.pgx-services-nav > div
) {
	color: var(--pg-text) !important;
	border-color: var(--pg-border) !important;
	background: var(--pg-surface-raised) !important;
}

html[data-theme="dark"] :is(.pandargah-search-field input, .pandargah-drawer-search input) {
	color: var(--pg-text);
	background: transparent;
}

html[data-theme="dark"] .pandargah-backdrop {
	background: rgba(0, 10, 12, .7);
}

/* Homepage */
html[data-theme="dark"] body.pendargah-home-v4 {
	--ink: var(--pg-text);
	--muted: var(--pg-text-muted);
	--ice: var(--pg-surface);
	--soft: var(--pg-surface-soft);
	--line: var(--pg-border);
	--white: var(--pg-surface);
	background: var(--pg-bg);
}

html[data-theme="dark"] body.pendargah-home-v4 :is(
	.hero-art,
	.path,
	.path-answer,
	.product,
	.product .cover,
	.chips button,
	.gift-note,
	.podcast-feature,
	.self-panel,
	.orbit,
	.closing,
	dialog
) {
	color: var(--pg-text);
	border-color: var(--pg-border);
	background: var(--pg-surface);
}

html[data-theme="dark"] body.pendargah-home-v4 :is(
	.courses-section,
	.path-answer,
	.podcast-feature,
	.self-panel,
	.closing
) {
	background: var(--pg-surface-raised);
}

html[data-theme="dark"] body.pendargah-home-v4 :is(
	.floating-note,
	.path-answer .btn:not(:first-child),
	.cover-tag,
	.orbit
) {
	color: var(--pg-text);
	border-color: var(--pg-border);
	background: rgba(16, 52, 56, .95);
}

html[data-theme="dark"] body.pendargah-home-v4 .path.active {
	border-color: var(--pg-primary);
	background: #0e4447;
}

html[data-theme="dark"] body.pendargah-home-v4 .gift-note {
	background: #0d383a;
}

html[data-theme="dark"] body.pendargah-home-v4 :is(
	.eyebrow,
	em,
	.btn.text,
	.link,
	.product .view-label,
	.product-arrow,
	.editorial .meta b,
	.author-sign,
	.faqs summary::after,
	.faqs p a,
	dialog a
) {
	color: var(--pg-primary);
}

html[data-theme="dark"] body.pendargah-home-v4 .price {
	color: var(--pg-text);
}

html[data-theme="dark"] body.pendargah-home-v4 .path b {
	color: #ff9fbd !important;
}

html[data-theme="dark"] body.pendargah-home-v4 .app-panel .eyebrow.light {
	color: #9adecf;
}

html[data-theme="dark"] body.pendargah-home-v4 :is(.author-photo, .self-art) {
	background: radial-gradient(circle, rgba(25, 191, 193, .22), transparent 67%);
}

/* Shared product/content modules. */
html[data-theme="dark"] :is(
	.adel-404,
	.adel-blogpage,
	.adel-cartpage,
	.adel-checkoutpage,
	.adel-contactpage,
	.adel-course,
	.adel-orderpage,
	.adel-shop,
	.adel-article,
	.adel-podcast,
	.adel-video
) {
	color: var(--pg-text);
	background: var(--pg-bg);
}

html[data-theme="dark"] :is(
	.adel-account,
	.adel-account-sidebar,
	.adel-blogpage,
	.adel-cartpage,
	.adel-checkoutpage,
	.adel-contactpage,
	.adel-course,
	.adel-orderpage,
	.adel-shop,
	.adel-article,
	.adel-podcast,
	.adel-video,
	.adel-tk
) :is(h1, h2, h3, h4) {
	color: var(--pg-text);
}

html[data-theme="dark"] :is(
	.adel-account,
	.adel-account-sidebar,
	.adel-blogpage,
	.adel-cartpage,
	.adel-checkoutpage,
	.adel-contactpage,
	.adel-course,
	.adel-orderpage,
	.adel-shop,
	.adel-article,
	.adel-podcast,
	.adel-video,
	.adel-tk
) :is(p, small, time, .meta, [class*="muted"]) {
	color: var(--pg-text-muted);
}

html[data-theme="dark"] :is(
	.adel-account-sidebar,
	.adel-welcome,
	.adel-summary-card,
	.adel-continue,
	.adel-blog-filters,
	.adel-format-pill,
	.adel-cartpage .adel-cart-card,
	.adel-cartpage .adel-summary,
	.adel-cartpage .adel-steps,
	.adel-checkoutpage #customer_details,
	.adel-checkoutpage #order_review,
	.adel-shop .adel-filter-bar,
	.adel-shop .adel-product,
	.adel-orderpage .adel-receipt-strip,
	.adel-orderpage .adel-access-card,
	.adel-orderpage .adel-order-details,
	.adel-article .quick,
	.adel-article .side-card,
	.adel-article .mobile-toc,
	.adel-article .author,
	.adel-article .product-card,
	.adel-podcast .player,
	.adel-podcast .side-card,
	.adel-podcast .mobile-chapters,
	.adel-podcast .resource,
	.adel-podcast .host,
	.adel-podcast .episode-card,
	.adel-video .status,
	.adel-video .side,
	.adel-video .host,
	.adel-video .video-item,
	.adel-course .adel-side,
	.adel-tk-hero,
	.adel-tk-stat,
	.adel-tk-card,
	.adel-tk-side-card,
	.adel-tk-dialog
) {
	color: var(--pg-text);
	border-color: var(--pg-border);
	background: var(--pg-surface);
	box-shadow: var(--pg-theme-shadow-sm);
}

html[data-theme="dark"] :is(
	.adel-profile,
	.adel-blog-hero,
	.adel-cartpage,
	.adel-checkoutpage,
	.adel-shop,
	.adel-orderpage
) {
	background-image: radial-gradient(circle at 88% 0, rgba(0, 255, 255, .08), transparent 27rem), linear-gradient(180deg, var(--pg-bg), var(--pg-surface));
}

html[data-theme="dark"] :is(
	.adel-account,
	.adel-account-sidebar,
	.adel-blogpage,
	.adel-cartpage,
	.adel-checkoutpage,
	.adel-contactpage,
	.adel-course,
	.adel-orderpage,
	.adel-shop,
	.adel-article,
	.adel-podcast,
	.adel-video,
	.adel-tk
) :is(input, select, textarea) {
	color: var(--pg-text) !important;
	border-color: var(--pg-border) !important;
	background: var(--pg-surface-raised) !important;
}

html[data-theme="dark"] :is(
	.adel-back-shop,
	.adel-edit-btn,
	.adel-tk-btn-secondary,
	.adel-tk-open,
	.adel-tk-close,
	.adel-tk-new-again,
	.adel-podcast .speed-btn,
	.adel-cartpage .adel-coupon-btn
) {
	color: #8ff6f3 !important;
	border-color: var(--pg-border) !important;
	background: var(--pg-surface-raised) !important;
}

html[data-theme="dark"] :is(
	.adel-account-nav a:hover,
	.adel-filter-btn:hover,
	.adel-shop .adel-filter:hover,
	.adel-tk-ticket:hover,
	.adel-tk-tabs,
	.adel-course .adel-lesson:hover
) {
	color: var(--pg-text) !important;
	background: var(--pg-surface-raised) !important;
}

/* Subliminal music hub. Its page-scoped stylesheet uses local variables and
 * several explicit light surfaces, so both the aliases and those surfaces
 * must be mapped to the shared dark palette. */
html[data-theme="dark"] #psh-music-hub {
	--ink: var(--pg-text);
	--muted: var(--pg-text-muted);
	--teal: #63e6e2;
	--deep: #8ff6f3;
	--aqua: var(--pg-primary);
	--mint: var(--pg-surface-soft);
	--ice: var(--pg-surface-raised);
	--cream: var(--pg-bg);
	--line: var(--pg-border);
	--white: var(--pg-surface);
	--focus: var(--pg-focus);
	background: var(--pg-bg);
	color: var(--pg-text);
}

html[data-theme="dark"] #psh-music-hub :is(
	.psh-cover,
	.psh-now-playing,
	.psh-controls,
	.psh-filters button,
	.psh-controls select,
	.psh-card,
	.psh-empty,
	.psh-mini-points span,
	.psh-steps li,
	.psh-faq details
) {
	color: var(--pg-text);
	border-color: var(--pg-border);
	background: var(--pg-surface);
	box-shadow: var(--pg-theme-shadow-sm);
}

html[data-theme="dark"] #psh-music-hub :is(
	.psh-cover > span,
	.psh-image-label,
	.psh-now-playing,
	.psh-button-light
) {
	color: var(--pg-text);
	border-color: var(--pg-border);
	background: rgba(16, 52, 56, .96);
}

html[data-theme="dark"] #psh-music-hub :is(
	.psh-button-primary,
	.psh-filters button[aria-pressed="true"],
	.psh-badge,
	.psh-image-play
) {
	color: var(--pg-text) !important;
	border-color: #298689;
	background: #0c5559;
}

html[data-theme="dark"] #psh-music-hub :is(
	.psh-button-primary:hover,
	.psh-filters button[aria-pressed="true"]:hover
) {
	color: var(--pg-text) !important;
	background: #11686c;
}

html[data-theme="dark"] #psh-music-hub .psh-hero h1 em {
	background: linear-gradient(transparent 77%, rgba(0, 255, 255, .2) 77%);
}

html[data-theme="dark"] #psh-music-hub :is(.psh-dot, .psh-art-orbit) {
	box-shadow: none;
}

html[data-theme="dark"] #psh-music-hub .psh-art-orbit {
	border-color: var(--pg-border);
	background: radial-gradient(circle, rgba(25, 191, 193, .2), transparent 68%);
}

html[data-theme="dark"] #psh-music-hub :is(
	.psh-card-bottom,
	.psh-faq,
	.psh-text-link
) {
	border-color: var(--pg-border);
}

html[data-theme="dark"] #psh-music-hub :is(
	.psh-price del,
	.psh-catalog-note
) {
	color: var(--pg-text-muted);
}

html[data-theme="dark"] #psh-music-hub .psh-guide {
	color: var(--pg-text);
	border-color: var(--pg-border);
	background: radial-gradient(circle at 100% 0, rgba(25, 191, 193, .16), transparent 34%), var(--pg-surface-raised);
}

html[data-theme="dark"] #psh-music-hub .psh-card:hover {
	border-color: var(--pg-primary);
	box-shadow: var(--pg-theme-shadow);
}

html[data-theme="dark"] #psh-music-hub .psh-filters button:hover {
	color: #8ff6f3;
	border-color: var(--pg-primary);
}

@media (max-width: 620px) {
	html[data-theme="dark"] #psh-music-hub .psh-text-link {
		background: var(--pg-surface);
	}
}

/* Self-knowledge test hub. Keep its distinct editorial styling while mapping
 * every fixed light card, control and notice onto readable dark surfaces. */
html[data-theme="dark"] #pdh-test-hub {
	--pdh-ink: var(--pg-text);
	--pdh-muted: var(--pg-text-muted);
	--pdh-teal: #63e6e2;
	--pdh-deep: #8ff6f3;
	--pdh-mint: var(--pg-surface-soft);
	--pdh-cream: var(--pg-bg);
	--pdh-line: var(--pg-border);
	--pdh-white: var(--pg-surface);
	--pdh-focus: var(--pg-focus);
	background: var(--pg-bg);
	color: var(--pg-text);
}

html[data-theme="dark"] #pdh-test-hub :is(
	.pdh-art-main,
	.pdh-art-small,
	.pdh-controls,
	.pdh-filters button,
	.pdh-controls select,
	.pdh-card,
	.pdh-empty,
	.pdh-product-card,
	.pdh-faq details
) {
	color: var(--pg-text);
	border-color: var(--pg-border);
	background: var(--pg-surface);
	box-shadow: var(--pg-theme-shadow-sm);
}

html[data-theme="dark"] #pdh-test-hub :is(
	.pdh-button-primary,
	.pdh-filters button[aria-pressed="true"],
	.pdh-popular-label,
	.pdh-empty .pdh-button
) {
	color: var(--pg-text) !important;
	border-color: #298689;
	background: #0c5559;
}

html[data-theme="dark"] #pdh-test-hub :is(
	.pdh-button-primary:hover,
	.pdh-filters button[aria-pressed="true"]:hover
) {
	color: var(--pg-text) !important;
	background: #11686c;
}

html[data-theme="dark"] #pdh-test-hub .pdh-hero h1 em {
	background: linear-gradient(transparent 78%, rgba(0, 255, 255, .2) 78%);
}

html[data-theme="dark"] #pdh-test-hub .pdh-art-orbit {
	border-color: var(--pg-border);
	background: radial-gradient(ellipse at center, rgba(25, 191, 193, .17), transparent 70%);
}

html[data-theme="dark"] #pdh-test-hub :is(
	.pdh-image-label,
	.pdh-steps li > span,
	.pdh-product-card > img
) {
	color: var(--pg-text);
	border-color: var(--pg-border);
	background: var(--pg-surface-raised);
}

html[data-theme="dark"] #pdh-test-hub :is(
	.pdh-card-meta,
	.pdh-card p,
	.pdh-product-card p,
	.pdh-product-footnote,
	.pdh-order-note
) {
	color: var(--pg-text-muted);
}

html[data-theme="dark"] #pdh-test-hub :is(
	.pdh-card-cta,
	.pdh-steps li,
	.pdh-faq,
	.pdh-bottom-note
) {
	border-color: var(--pg-border);
}

html[data-theme="dark"] #pdh-test-hub .pdh-guide {
	color: var(--pg-text);
	border-color: var(--pg-border);
	background: var(--pg-surface-raised);
}

html[data-theme="dark"] #pdh-test-hub .pdh-crisis-note {
	color: #f2d6b4;
	border-color: #806a50;
	background: #2a241f;
}

html[data-theme="dark"] #pdh-test-hub :is(.pdh-card:hover, .pdh-product-card:hover) {
	border-color: var(--pg-primary);
	box-shadow: var(--pg-theme-shadow);
}

html[data-theme="dark"] #pdh-test-hub .pdh-filters button:hover {
	color: #8ff6f3;
	border-color: var(--pg-primary);
}

/* Login, support chat, tests and experiences own local variables. */
html[data-theme="dark"] .pg-login {
	--pg-ink: var(--pg-text);
	--pg-muted: var(--pg-text-muted);
	--pg-ice: var(--pg-surface-raised);
	--pg-line: var(--pg-border);
	color: var(--pg-text);
	border-color: var(--pg-border);
	background: var(--pg-surface);
}

html[data-theme="dark"] .pg-login :is(
	.pg-login__close,
	.pg-login__switch,
	.pg-login__switch-button[aria-selected="true"],
	.pg-login__phone,
	.pg-login__password,
	.pg-login__text-control,
	.pg-login__identity,
	.pg-login__change,
	.pg-login__secondary,
	.pg-login__otp-input
) {
	color: var(--pg-text) !important;
	border-color: var(--pg-border) !important;
	background: var(--pg-surface-raised) !important;
}

html[data-theme="dark"] {
	--gc-ink: var(--pg-text);
	--gc-muted: var(--pg-text-muted);
	--gc-surface: var(--pg-surface);
	--gc-line: var(--pg-border);
}

html[data-theme="dark"] .adel-gc-panel :is(
	.adel-gc-answer-card,
	.adel-gc-control,
	.adel-gc-bubble.support,
	.adel-gc-reply-input
) {
	color: var(--pg-text) !important;
	border-color: var(--pg-border) !important;
	background: var(--pg-surface-raised) !important;
}

html[data-theme="dark"] .aml {
	--aml-ink: var(--pg-text);
	--aml-muted: var(--pg-text-muted);
	--aml-green: #70d7c2;
	--aml-pale: var(--pg-surface-raised);
	--aml-line: var(--pg-border);
	color-scheme: dark;
}

html[data-theme="dark"] .pg-service {
	--pg-ink: var(--pg-text);
	--pg-muted: var(--pg-text-muted);
	--pg-line: var(--pg-border);
	--pg-sand: var(--pg-surface-raised);
	color: var(--pg-text);
}

html[data-theme="dark"] :is(
	.pgx-public,
	.pgx-about,
	.pgx-options article,
	.pgx-availability,
	.pgx-intake,
	.pgx-message,
	.pgx-services-nav > div
) {
	color: var(--pg-text);
	border-color: var(--pg-border);
	background: var(--pg-surface);
}

html[data-theme="dark"] .pg-service :is(input, select, textarea) {
	color: var(--pg-text);
	border-color: var(--pg-border);
	background: var(--pg-surface-raised);
}

@media (max-width: 640px) {
	.pandargah-theme-menu {
		position: fixed;
		top: 92px;
		inset-inline: 14px;
		width: auto;
	}
}

@media (prefers-reduced-motion: reduce) {
	.pandargah-theme-toggle svg,
	.pandargah-theme-menu,
	html[data-theme] * {
		transition-duration: .01ms !important;
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
	}
}

@media print {
	.pandargah-theme-control {
		display: none !important;
	}
	html {
		color-scheme: light !important;
	}
}
