.atlas-link {
	cursor: pointer;
	text-decoration: underline dotted;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
	border-radius: 2px;
	transition: background-color 0.2s ease;
}

.atlas-link:hover,
.atlas-link[aria-expanded="true"] {
	background-color: rgba(200, 98, 38, 0.12);
	text-decoration-style: solid;
}

.atlas-link:focus-visible {
	outline: 2px solid #c86226;
	outline-offset: 2px;
}

.atlas-card,
.atlas-panel,
.atlas-backdrop,
.atlas-notice {
	--atlas-bg: #ffffff;
	--atlas-fg: #18181b;
	--atlas-muted: #71717a;
	--atlas-line: #e4e4e7;
	--atlas-soft: #f4f4f5;
	--atlas-accent: #c2551a;
	--atlas-accent-fg: #ffffff;
	--atlas-shadow: 0 18px 40px -16px rgba(24, 24, 27, 0.28), 0 2px 6px -2px rgba(24, 24, 27, 0.08);
	box-sizing: border-box;
	color: var(--atlas-fg);
	font-family: inherit;
	font-size: 15px;
	line-height: 1.45;
	letter-spacing: normal;
	text-align: left;
}

@media (prefers-color-scheme: dark) {
	.atlas-card,
	.atlas-panel,
	.atlas-backdrop,
	.atlas-notice {
		--atlas-bg: #1c1c1f;
		--atlas-fg: #f4f4f5;
		--atlas-muted: #a1a1aa;
		--atlas-line: #2f2f34;
		--atlas-soft: #26262a;
		--atlas-accent: #e0763a;
		--atlas-accent-fg: #18181b;
		--atlas-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.7), 0 2px 6px -2px rgba(0, 0, 0, 0.4);
	}
}

.atlas-card *,
.atlas-panel *,
.atlas-notice * {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
	font-family: inherit;
}

.atlas-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.atlas-muted {
	color: var(--atlas-muted);
	font-size: 13px;
}

/* Card */

.atlas-card {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 99990;
	width: min(296px, calc(100vw - 16px));
	padding: 14px 16px 12px;
	background: var(--atlas-bg);
	border: 1px solid var(--atlas-line);
	border-radius: 12px;
	box-shadow: var(--atlas-shadow);
	cursor: pointer;
	opacity: 0;
	scale: 0.97;
	transition: opacity 0.18s ease, scale 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.atlas-card.is-open {
	opacity: 1;
	scale: 1;
}

.atlas-card[hidden],
.atlas-panel[hidden],
.atlas-backdrop[hidden] {
	display: none;
}

.atlas-head {
	display: grid;
	gap: 2px;
}

.atlas-head.has-photo-slot {
	grid-template-columns: auto 1fr;
	align-items: center;
	gap: 14px;
}

.atlas-head-text {
	display: grid;
	gap: 2px;
	min-width: 0;
}

.atlas-photo {
	position: relative;
	width: 60px;
	height: 80px;
	overflow: hidden;
	border: 2px solid var(--atlas-accent);
	border-radius: 14px;
	background: var(--atlas-soft);
}

.atlas-panel .atlas-photo {
	width: 84px;
	height: 112px;
}

.atlas-initials {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--atlas-muted);
	font-size: 20px;
	font-weight: 700;
}

.atlas-photo img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: contain;
	object-position: center bottom;
	opacity: 0;
	transition: opacity 0.2s ease;
}

/* Blurred copy fills the sides around the whole photo. */
.atlas-photo img.atlas-photo-fill {
	object-fit: cover;
	filter: blur(8px);
	transform: scale(1.2);
}

.atlas-photo.has-photo img {
	opacity: 1;
}

.atlas-kicker {
	color: var(--atlas-accent);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.atlas-name {
	color: var(--atlas-fg);
	font-size: 17px;
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: -0.01em;
}

.atlas-sub {
	color: var(--atlas-muted);
	font-size: 13px;
}

.atlas-stats-wrap {
	margin-top: 12px;
	padding-top: 10px;
	border-top: 1px solid var(--atlas-line);
}

.atlas-season {
	margin-bottom: 6px !important;
	color: var(--atlas-muted);
	font-size: 11px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.atlas-stats {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 4px;
}

.atlas-stat {
	display: flex;
	flex-direction: column-reverse;
	justify-content: flex-end;
	gap: 1px;
}

.atlas-stat-value {
	font-size: 16px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	line-height: 1.2;
}

.atlas-stat-label {
	color: var(--atlas-muted);
	font-size: 11px;
	font-weight: 500;
}

.atlas-card .atlas-facts {
	margin-top: 10px;
	padding-top: 10px;
	border-top: 1px solid var(--atlas-line);
}

.atlas-hint {
	margin-top: 10px !important;
	color: var(--atlas-muted);
	font-size: 12px;
}

/* Skeleton */

.atlas-skeleton {
	display: grid;
	gap: 8px;
}

.atlas-bone {
	display: block;
	height: 12px;
	border-radius: 6px;
	background: linear-gradient(90deg, var(--atlas-soft) 25%, var(--atlas-line) 50%, var(--atlas-soft) 75%);
	background-size: 200% 100%;
	animation: atlas-shimmer 1.4s ease-in-out infinite;
}

.atlas-bone:first-child {
	width: 30%;
	height: 10px;
}

.atlas-bone:nth-child(2) {
	width: 70%;
	height: 16px;
}

.atlas-bone:nth-child(3) {
	width: 55%;
}

@keyframes atlas-shimmer {
	from {
		background-position: 100% 0;
	}

	to {
		background-position: -100% 0;
	}
}

/* Panel */

.atlas-locked,
.atlas-locked body {
	overflow: hidden !important;
}

.atlas-backdrop {
	position: fixed;
	inset: 0;
	z-index: 99991;
	background: rgba(24, 24, 27, 0.42);
	opacity: 0;
	transition: opacity 0.25s ease;
}

.atlas-backdrop.is-open {
	opacity: 1;
}

.atlas-panel {
	position: fixed;
	top: var(--wp-admin--admin-bar--height, 0px); /* below the WP admin bar when logged in */
	bottom: 0;
	left: 0;
	z-index: 99992;
	display: flex;
	flex-direction: column;
	width: min(400px, 92vw);
	background: var(--atlas-bg);
	border-right: 1px solid var(--atlas-line);
	box-shadow: var(--atlas-shadow);
	transform: translateX(-100%);
	transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

.atlas-panel.is-open {
	transform: translateX(0);
}

.atlas-panel-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 12px 14px 20px;
	background: #0f1d4a;
	border-bottom: 3px solid #eb6919;
}

.atlas-logo {
	display: block;
	width: auto;
	height: 28px;
}

.atlas-panel-bar .atlas-close {
	color: #ffffff;
}

.atlas-panel-bar .atlas-close:hover {
	background: rgba(255, 255, 255, 0.12);
}

.atlas-brand {
	color: #ffffff;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.atlas-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	color: var(--atlas-fg);
	background: transparent;
	border: 0;
	border-radius: 8px;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.atlas-close:hover {
	background: var(--atlas-soft);
}

.atlas-close:focus-visible,
.atlas-btn:focus-visible {
	outline: 2px solid var(--atlas-accent);
	outline-offset: 2px;
}

.atlas-panel-body {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 20px;
	padding: 22px 20px 28px;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.atlas-panel .atlas-name {
	font-size: 24px;
	letter-spacing: -0.02em;
}

.atlas-panel .atlas-sub {
	font-size: 14px;
}

.atlas-panel .atlas-stats-wrap {
	margin-top: 0;
	padding: 14px 16px;
	background: var(--atlas-soft);
	border: 0;
	border-radius: 10px;
}

.atlas-panel .atlas-stat-value {
	font-size: 20px;
}

.atlas-facts {
	display: grid;
}

.atlas-fact {
	display: grid;
	grid-template-columns: 7.5em 1fr;
	gap: 12px;
	padding: 6px 0;
	font-size: 14px;
}

.atlas-panel .atlas-fact {
	padding: 10px 0;
	border-bottom: 1px solid var(--atlas-line);
}

.atlas-fact dt {
	color: var(--atlas-muted);
}

.atlas-fact dd {
	font-weight: 500;
	overflow-wrap: anywhere;
}

.atlas-card .atlas-fact {
	padding: 2px 0;
	font-size: 13px;
}

.atlas-actions {
	display: grid;
	gap: 10px;
	margin-top: auto;
}

.atlas-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 46px;
	padding: 10px 16px;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none !important;
	border-radius: 10px;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.atlas-btn:active {
	transform: translateY(1px) scale(0.99);
}

.atlas-btn-ghost {
	color: var(--atlas-fg) !important;
	background: transparent;
	border: 1px solid var(--atlas-line);
}

.atlas-btn-ghost:hover {
	background: var(--atlas-soft);
}

.atlas-btn-primary {
	color: var(--atlas-accent-fg);
	background: var(--atlas-accent);
	border: 1px solid var(--atlas-accent);
}

.atlas-btn-primary:hover {
	filter: brightness(1.06);
}

.atlas-btn-primary:disabled {
	cursor: progress;
	opacity: 0.7;
}

.atlas-buy {
	display: grid;
	gap: 6px;
}

.atlas-note {
	color: var(--atlas-muted);
	font-size: 12px;
	text-align: center;
}

.atlas-error {
	color: #b42318;
	font-size: 13px;
	font-weight: 500;
}

.atlas-error:empty {
	display: none;
}

@media (prefers-color-scheme: dark) {
	.atlas-error {
		color: #f97066;
	}
}

/* Purchase notice */

.atlas-notice {
	position: fixed;
	right: 16px;
	bottom: 16px;
	left: 16px;
	z-index: 99993;
	display: flex;
	align-items: center;
	gap: 12px;
	max-width: 440px;
	margin: 0 auto;
	padding: 12px 8px 12px 16px;
	background: var(--atlas-bg);
	border: 1px solid var(--atlas-line);
	border-radius: 12px;
	box-shadow: var(--atlas-shadow);
	animation: atlas-rise 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.atlas-notice p {
	flex: 1;
	font-size: 14px;
	font-weight: 500;
}

.atlas-notice-dot {
	flex: none;
	width: 10px;
	height: 10px;
	background: #16a34a;
	border-radius: 50%;
	box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.18);
}

@keyframes atlas-rise {
	from {
		opacity: 0;
		transform: translateY(12px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Purchase progress + report */

.atlas-locked .atlas-notice {
	display: none;
}

.atlas-notice-text {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.atlas-notice .atlas-notice-phrase {
	color: var(--atlas-muted);
	font-size: 12px;
	font-weight: 400;
}

.atlas-notice-phrase[hidden] {
	display: none;
}

.atlas-notice-btn {
	flex: none;
	padding: 7px 12px;
	color: var(--atlas-accent-fg);
	font-size: 13px;
	font-weight: 600;
	line-height: 1.2;
	background: var(--atlas-accent);
	border: 0;
	border-radius: 8px;
	cursor: pointer;
}

.atlas-notice-btn:hover {
	filter: brightness(1.08);
}

.atlas-notice-btn:focus-visible {
	outline: 2px solid var(--atlas-accent);
	outline-offset: 2px;
}

.atlas-notice-btn[hidden] {
	display: none;
}

.atlas-notice[data-state="confirming"] .atlas-notice-dot,
.atlas-notice[data-state="pending"] .atlas-notice-dot,
.atlas-notice[data-state="generating"] .atlas-notice-dot {
	background: var(--atlas-accent);
	box-shadow: 0 0 0 4px rgba(194, 85, 26, 0.18);
	animation: atlas-pulse 1.4s ease-in-out infinite;
}

.atlas-notice[data-state="failed"] .atlas-notice-dot,
.atlas-notice[data-state="slow"] .atlas-notice-dot,
.atlas-notice[data-state="lost"] .atlas-notice-dot {
	background: #d97706;
	box-shadow: 0 0 0 4px rgba(217, 119, 6, 0.18);
}

.atlas-panel.is-report {
	width: min(560px, 100vw);
}

.atlas-progress {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	padding: 28px 20px 24px;
	overflow: hidden;
	text-align: center;
	background:
		radial-gradient(120% 70% at 50% 0%, rgba(194, 85, 26, 0.1), transparent 70%),
		var(--atlas-soft);
	border: 1px solid var(--atlas-line);
	border-radius: 14px;
}

.atlas-dribble {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-end;
	height: 96px;
	padding-bottom: 6px;
	margin-bottom: 4px;
}

.atlas-dribble-ball {
	display: block;
	color: var(--atlas-accent);
	transform-origin: 50% 100%;
	animation: atlas-dribble 0.9s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

.atlas-dribble-shadow {
	position: absolute;
	bottom: 2px;
	width: 40px;
	height: 6px;
	background: rgba(24, 24, 27, 0.28);
	border-radius: 50%;
	filter: blur(2px);
	animation: atlas-dribble-shadow 0.9s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

@media (prefers-color-scheme: dark) {
	.atlas-dribble-shadow {
		background: rgba(0, 0, 0, 0.6);
	}
}

.atlas-progress-status {
	font-size: 15px;
	font-weight: 600;
	letter-spacing: -0.01em;
}

.atlas-progress-phrase {
	min-height: 1.45em;
	color: var(--atlas-accent);
	font-size: 13px;
	font-weight: 500;
}

.atlas-phrase.is-in {
	animation: atlas-phrase 0.35s ease-out;
}

.atlas-progress .atlas-note {
	max-width: 320px;
	margin-top: 8px;
	padding-top: 14px;
	border-top: 1px solid var(--atlas-line);
	line-height: 1.5;
}

.atlas-report-h {
	margin-bottom: 8px;
	color: var(--atlas-accent);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.atlas-bottom-line {
	padding: 14px 16px;
	background: var(--atlas-soft);
	border-left: 3px solid var(--atlas-accent);
	border-radius: 8px;
}

.atlas-rich {
	display: flex;
	flex-direction: column;
	gap: 10px;
	font-size: 14px;
	line-height: 1.6;
}

.atlas-rich ul {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding-left: 18px;
	list-style: disc;
}

.atlas-rich strong {
	font-weight: 600;
}

.atlas-rich h4 {
	font-size: 14px;
	font-weight: 600;
}

@keyframes atlas-pulse {
	50% {
		box-shadow: 0 0 0 7px rgba(194, 85, 26, 0.08);
	}
}

@keyframes atlas-dribble {
	0%,
	100% {
		transform: translateY(0) scale(1.08, 0.9);
	}

	12% {
		transform: translateY(-6px) scale(0.97, 1.04);
	}

	50% {
		transform: translateY(-40px) scale(1);
	}

	88% {
		transform: translateY(-6px) scale(0.97, 1.04);
	}
}

@keyframes atlas-dribble-shadow {
	0%,
	100% {
		opacity: 1;
		transform: scaleX(1);
	}

	50% {
		opacity: 0.35;
		transform: scaleX(0.55);
	}
}

@keyframes atlas-phrase {
	from {
		opacity: 0;
		transform: translateY(4px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@media (prefers-reduced-motion: reduce) {
	.atlas-card,
	.atlas-panel,
	.atlas-backdrop,
	.atlas-notice,
	.atlas-bone,
	.atlas-notice-dot,
	.atlas-dribble-ball,
	.atlas-dribble-shadow,
	.atlas-phrase.is-in {
		transition: none;
		animation: none;
	}
}
