/*
 * Keep the course score card's desktop width independent of the advice copy.
 *
 * TownHub lays the hero out with flexbox. Without an explicit flex basis, a
 * longer paragraph becomes part of the card's intrinsic width and pushes the
 * 50% course-information column aside. These values mirror the existing gauge
 * sizes and gaps, plus the card's existing 5vw padding on both sides. The
 * gauges themselves are deliberately left unchanged.
 */
@media (min-width: 1025px) {
	.hero.highlight.is-home > .tl-cbr-score-card {
		flex: 0 0 calc(580px + 10vw);
		min-width: 0;
		width: calc(580px + 10vw);
	}
}

@media (min-width: 769px) and (max-width: 1024px) {
	.hero.highlight.is-home > .tl-cbr-score-card {
		flex: 0 0 calc(490px + 10vw);
		min-width: 0;
		width: calc(490px + 10vw);
	}
}

@media (min-width: 749px) and (max-width: 768px) {
	.hero.highlight.is-home > .tl-cbr-score-card {
		flex: 0 0 calc(340px + 10vw);
		min-width: 0;
		width: calc(340px + 10vw);
	}
}

.hero.highlight.is-home > .tl-cbr-score-card > p {
	max-width: 100%;
	overflow-wrap: break-word;
}

/*
 * A gauge must never participate in horizontal flex shrinking. TownHub sets
 * equal width/height at each breakpoint, but flex-shrink can reduce only its
 * computed width when the score card is constrained, turning the canvas oval.
 */
.tl-cbr-score-card .gauge-card {
	flex-shrink: 0;
	aspect-ratio: 1 / 1;
}

.tl-cbr-score-card .tl-cbr-gauge {
	display: block;
	aspect-ratio: 1 / 1;
}

/*
 * Attempt Details language picker parity.
 *
 * Quiz Experience 1.1.7 is the visual source of truth. These declarations
 * reproduce its existing picker contract only on the completed-attempt
 * Details body class. No selector below targets body.tlqx-active, so the live
 * quiz and its already-correct UI cannot be changed by the score engine.
 */
body.tlqx-header-page-details .tlqx-language-picker {
	position: relative;
}

body.tlqx-header-page-details .tlqx-icon-button {
	position: relative !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	min-width: 44px !important;
	height: 44px !important;
	margin: 0 !important;
	padding: 0 10px !important;
	border: 1px solid rgba(255, 255, 255, 0.13) !important;
	border-radius: 9px !important;
	background: rgba(255, 255, 255, 0.06) !important;
	box-shadow: none !important;
	color: #fff !important;
	text-decoration: none !important;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

body.tlqx-header-page-details .tlqx-icon-button:hover,
body.tlqx-header-page-details .tlqx-icon-button:focus-visible {
	border-color: rgba(255, 255, 255, 0.34) !important;
	background: rgba(255, 255, 255, 0.13) !important;
	outline: 3px solid rgba(64, 165, 255, 0.28) !important;
	outline-offset: 1px !important;
}

body.tlqx-header-page-details .tlqx-language-toggle {
	gap: 6px !important;
	max-width: 164px !important;
}

body.tlqx-header-page-details .tlqx-current-flag {
	display: inline !important;
	font-size: 19px !important;
	line-height: 1 !important;
}

body.tlqx-header-page-details .tlqx-current-language {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: 12px !important;
	font-weight: 700 !important;
}

body.tlqx-header-page-details .tlqx-chevron {
	width: 14px !important;
	height: 14px !important;
	flex: 0 0 14px !important;
	transition: transform 0.15s ease;
}

body.tlqx-header-page-details .tlqx-language-toggle[aria-expanded="true"] .tlqx-chevron {
	transform: rotate(180deg);
}

body.tlqx-header-page-details .tlqx-language-menu {
	position: absolute !important;
	z-index: 2000 !important;
	inset-block-start: calc(100% + 7px) !important;
	inset-inline-end: 0 !important;
	display: grid;
	width: min(238px, calc(100vw - 24px)) !important;
	max-height: min(420px, calc(100dvh - 80px)) !important;
	padding: 6px !important;
	overflow-y: auto;
	overscroll-behavior: contain;
	border: 1px solid rgba(255, 255, 255, 0.15) !important;
	border-radius: 11px !important;
	background: #ffffff !important;
	box-shadow: 0 18px 46px rgba(5, 0, 18, 0.34) !important;
	color: #102a3d !important;
	direction: ltr !important;
	text-align: left !important;
}

body.tlqx-header-page-details .tlqx-language-menu[hidden] {
	display: none !important;
}

body.tlqx-header-page-details .tlqx-language-menu.is-open:not([hidden]) {
	display: grid !important;
}

body.tlqx-header-page-details .tlqx-language-menu .tlqx-language-option.lang-quiz {
	display: grid !important;
	grid-template-columns: 28px minmax(0, 1fr) !important;
	align-items: center !important;
	justify-items: start !important;
	gap: 9px !important;
	width: 100% !important;
	height: auto !important;
	min-height: 42px !important;
	margin: 0 !important;
	padding: 8px 10px !important;
	-webkit-appearance: none !important;
	appearance: none !important;
	border: 0 !important;
	border-color: transparent !important;
	border-style: none !important;
	border-width: 0 !important;
	border-radius: 7px !important;
	background: transparent !important;
	box-shadow: none !important;
	filter: none !important;
	outline: none !important;
	outline-offset: 0 !important;
	outline-width: 0 !important;
	transform: none !important;
	color: #102a3d !important;
	font: inherit !important;
	font-size: 13px !important;
	font-weight: 600 !important;
	text-align: left !important;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

body.tlqx-header-page-details .tlqx-language-menu .tlqx-language-option.lang-quiz:hover,
body.tlqx-header-page-details .tlqx-language-menu .tlqx-language-option.lang-quiz:focus-visible {
	border: 0 !important;
	box-shadow: none !important;
	outline: none !important;
	background: #edf6ff !important;
}

body.tlqx-header-page-details .tlqx-language-menu .tlqx-language-option.lang-quiz.active-lang-btn,
body.tlqx-header-page-details .tlqx-language-menu .tlqx-language-option.lang-quiz[aria-checked="true"] {
	border: 0 !important;
	box-shadow: none !important;
	outline: none !important;
	background: #dcedff !important;
	color: #005cb5 !important;
}

body.tlqx-header-page-details .tlqx-current-flag img.emoji,
body.tlqx-header-page-details .tlqx-language-flag img.emoji {
	display: inline !important;
	width: 1em !important;
	height: 1em !important;
	margin: 0 0.07em !important;
	padding: 0 !important;
	border: 0 !important;
	background: none !important;
	box-shadow: none !important;
	vertical-align: -0.1em !important;
}

body.tlqx-header-page-details .tlqx-language-flag {
	display: inline !important;
	font-size: 20px !important;
	line-height: 1 !important;
}

@media (max-width: 600px) {
	body.tlqx-header-page-details .tlqx-current-language,
	body.tlqx-header-page-details .tlqx-language-toggle .tlqx-chevron {
		display: none !important;
	}

	body.tlqx-header-page-details .tlqx-language-toggle {
		gap: 0 !important;
		width: 40px !important;
		min-width: 40px !important;
		height: 40px !important;
		padding: 0 !important;
	}

	body.tlqx-header-page-details .tlqx-current-flag {
		font-size: 18px !important;
	}

	body.tlqx-header-page-details .tlqx-language-menu {
		inset-inline-end: 0 !important;
	}
}

.tl-cbr-reset-row {
	display: flex;
	justify-content: center;
	margin-top: 24px;
}

.tl-cbr-reset-open {
	align-items: center;
	background: transparent;
	border: 1px solid rgba(255, 255, 255, 0.35);
	border-radius: 6px;
	color: #fff;
	cursor: pointer;
	display: inline-flex;
	font: inherit;
	font-weight: 600;
	gap: 8px;
	min-height: 44px;
	padding: 10px 16px;
}

.tl-cbr-reset-open:hover,
.tl-cbr-reset-open:focus-visible {
	background: rgba(255, 255, 255, 0.1);
	border-color: #fff;
}

.tl-cbr-reset-notice {
	background: rgba(116, 185, 21, 0.18);
	border: 1px solid #74b915;
	border-radius: 6px;
	color: #fff;
	margin-bottom: 18px;
	padding: 12px 14px;
}

.tl-cbr-reset-modal[hidden] {
	display: none !important;
}

.tl-cbr-reset-modal {
	align-items: center;
	display: flex;
	inset: 0;
	justify-content: center;
	padding: 20px;
	position: fixed;
	z-index: 100000;
}

.tl-cbr-reset-backdrop {
	background: rgba(8, 18, 34, 0.72);
	inset: 0;
	position: absolute;
}

.tl-cbr-reset-dialog {
	background: #fff;
	border-radius: 10px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
	color: #1c2b45;
	max-width: 560px;
	padding: 28px;
	position: relative;
	width: 100%;
	z-index: 1;
}

.tl-cbr-reset-dialog h3 {
	color: #1c2b45;
	font-size: 24px;
	margin: 0 0 12px;
}

.tl-cbr-reset-dialog p {
	color: #46536a;
	line-height: 1.65;
	margin: 0;
}

.tl-cbr-reset-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	justify-content: flex-end;
	margin-top: 24px;
}

.tl-cbr-reset-actions button {
	border-radius: 6px;
	cursor: pointer;
	font: inherit;
	font-weight: 700;
	min-height: 44px;
	padding: 10px 16px;
}

.tl-cbr-reset-cancel {
	background: #fff;
	border: 1px solid #b8c0cc;
	color: #1c2b45;
}

.tl-cbr-reset-confirm {
	background: #e5253c;
	border: 1px solid #e5253c;
	color: #fff;
}

.tl-cbr-reset-confirm:disabled {
	cursor: wait;
	opacity: 0.65;
}

.tl-cbr-reset-error {
	color: #c51f34 !important;
	font-weight: 600;
	margin-top: 16px !important;
}

html.tl-cbr-modal-open {
	overflow: hidden;
}

@media (max-width: 600px) {
	.tl-cbr-reset-dialog {
		padding: 22px 18px;
	}

	.tl-cbr-reset-actions {
		flex-direction: column-reverse;
	}

	.tl-cbr-reset-actions button {
		width: 100%;
	}
}
