/**
 * Tebuk Hafalan AI-Quran - front end styles.
 *
 * Every rule is scoped under .thq-app or a thq- prefixed class so the plugin
 * cannot leak styles into the surrounding theme, and the theme cannot easily
 * leak into the application.
 *
 * Colour values come from CSS custom properties printed inline by
 * THQ_Assets::theme_css(), so the admin colour scheme applies without a
 * stylesheet rebuild.
 */

/* ---------------------------------------------------------------- Fonts */

@font-face {
	font-family: 'THQ Poppins';
	src: url('../fonts/Poppins-Regular.woff2') format('woff2');
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'THQ Poppins';
	src: url('../fonts/Poppins-Medium.woff2') format('woff2');
	font-weight: 500;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'THQ Poppins';
	src: url('../fonts/Poppins-SemiBold.woff2') format('woff2');
	font-weight: 600;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'THQ Poppins';
	src: url('../fonts/Poppins-Bold.woff2') format('woff2');
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'THQ Uthmanic';
	src: url('../fonts/uthmanic-hafs.woff2') format('woff2');
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'THQ IndoPak';
	src: url('../fonts/IndoPakQuran.woff2') format('woff2');
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

/* ------------------------------------------------------------- Fallbacks */

.thq-app {
	--thq-navy: #0f1b2d;
	--thq-navy-soft: #1b2a40;
	--thq-primary: #0e7a4f;
	--thq-primary-dark: #0a5c3b;
	--thq-primary-light: #d9f2e4;
	--thq-background: #edebfb;
	--thq-surface: #ffffff;
	--thq-surface-soft: #f4f7f9;
	--thq-text: #14202e;
	--thq-muted: #66748a;
	--thq-border: #e3e8f0;
	--thq-success: #0e7a4f;
	--thq-warning: #b7791f;
	--thq-danger: #c0392b;
	--thq-accent: #e8dfb8;
	--thq-arabic-size: 30px;

	--thq-radius-sm: 10px;
	--thq-radius: 16px;
	--thq-radius-lg: 22px;
	--thq-gap: 16px;
	--thq-shadow: 0 1px 2px rgba(16, 26, 40, .06), 0 8px 24px rgba(16, 26, 40, .06);
	--thq-shadow-lift: 0 12px 30px rgba(14, 122, 79, .18);

	font-family: 'THQ Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	color: var(--thq-text);
	background: var(--thq-background);
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
	box-sizing: border-box;
	position: relative;
	margin: 0 auto;
	max-width: 1400px;
	min-height: 60vh;
	border-radius: var(--thq-radius-lg);
	overflow: hidden;
}

.thq-app *,
.thq-app *::before,
.thq-app *::after {
	box-sizing: border-box;
}

.thq-app img {
	max-width: 100%;
	height: auto;
}

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

.thq-icon {
	width: 20px;
	height: 20px;
	display: block;
	flex: none;
}

/* --------------------------------------------------------------- Layout */

.thq-main {
	padding: 20px 16px 96px;
	min-width: 0;
}

.thq-app--bare .thq-main {
	padding-bottom: 32px;
}

.thq-page {
	display: flex;
	flex-direction: column;
	gap: 22px;
	max-width: 100%;
}

.thq-page__head {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.thq-page__title {
	font-size: 1.5rem;
	font-weight: 700;
	margin: 0;
	line-height: 1.25;
}

.thq-page__sub,
.thq-section__sub {
	margin: 0;
	color: var(--thq-muted);
	font-size: .875rem;
}

.thq-page__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	margin: 0;
}

/* -------------------------------------------------------------- Top bar */

.thq-topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 16px;
	background: var(--thq-surface);
	border-bottom: 1px solid var(--thq-border);
	position: sticky;
	top: 0;
	z-index: 20;
}

.thq-topbar__brand {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
}

.thq-topbar__brand strong {
	display: block;
	font-size: .95rem;
	font-weight: 600;
	line-height: 1.2;
}

.thq-topbar__brand small {
	display: block;
	font-size: .72rem;
	color: var(--thq-muted);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.thq-topbar__action {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	color: var(--thq-muted);
	background: var(--thq-surface-soft);
	text-decoration: none;
	flex: none;
}

.thq-brand__mark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border-radius: 12px;
	background: var(--thq-primary);
	color: #fff;
	flex: none;
}

/* -------------------------------------------------------------- Sidebar */

.thq-sidebar {
	display: none;
}

/* --------------------------------------------------------------- Tabbar */

.thq-tabbar {
	position: sticky;
	bottom: 0;
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: 1fr;
	background: var(--thq-surface);
	border-top: 1px solid var(--thq-border);
	padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
	z-index: 20;
}

.thq-tabbar__item {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 3px;
	padding: 7px 2px;
	color: var(--thq-muted);
	text-decoration: none;
	font-size: .7rem;
	font-weight: 500;
	border-radius: var(--thq-radius-sm);
}

.thq-tabbar__item.is-active {
	color: var(--thq-primary);
}

.thq-tabbar__label {
	line-height: 1;
}

/* ---------------------------------------------------------------- Cards */

.thq-card {
	background: var(--thq-surface);
	border: 1px solid var(--thq-border);
	border-radius: var(--thq-radius);
	padding: 18px;
	box-shadow: var(--thq-shadow);
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.thq-section {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.thq-section__head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
}

.thq-section__title {
	font-size: 1.05rem;
	font-weight: 600;
	margin: 0;
}

.thq-link {
	color: var(--thq-primary);
	font-size: .82rem;
	font-weight: 600;
	text-decoration: none;
}

.thq-link:hover,
.thq-link:focus-visible {
	text-decoration: underline;
}

/* ----------------------------------------------------------------- Hero */

.thq-hero {
	background: linear-gradient(135deg, var(--thq-primary-light), var(--thq-surface) 70%);
	border: 1px solid var(--thq-border);
	border-radius: var(--thq-radius-lg);
	padding: 20px;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.thq-hero__greeting {
	margin: 0;
	font-size: .9rem;
	color: var(--thq-muted);
}

.thq-hero__name {
	margin: 2px 0 6px;
	font-size: 1.6rem;
	font-weight: 700;
	line-height: 1.2;
}

.thq-hero__lead {
	margin: 0;
	font-size: .88rem;
	color: var(--thq-muted);
	max-width: 52ch;
}

.thq-hero__streak {
	display: flex;
	align-items: center;
	gap: 12px;
	background: var(--thq-surface);
	border: 1px solid var(--thq-border);
	border-radius: var(--thq-radius);
	padding: 12px 14px;
}

.thq-hero__streak-icon {
	display: inline-flex;
	width: 38px;
	height: 38px;
	align-items: center;
	justify-content: center;
	border-radius: 12px;
	background: var(--thq-accent);
	color: var(--thq-navy);
	flex: none;
}

.thq-hero__streak strong {
	display: block;
	font-size: .95rem;
}

.thq-hero__streak small {
	display: block;
	font-size: .78rem;
	color: var(--thq-muted);
}

/* ---------------------------------------------------------------- Stats */

.thq-stats {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
}

.thq-stat {
	background: var(--thq-surface);
	border: 1px solid var(--thq-border);
	border-radius: var(--thq-radius);
	padding: 14px;
	display: flex;
	flex-direction: column;
	gap: 2px;
	box-shadow: var(--thq-shadow);
}

.thq-stat__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: 10px;
	background: var(--thq-primary-light);
	color: var(--thq-primary-dark);
	margin-bottom: 6px;
}

.thq-stat__value {
	font-size: 1.35rem;
	font-weight: 700;
	line-height: 1.15;
}

.thq-stat__label {
	font-size: .76rem;
	color: var(--thq-muted);
}

/* ---------------------------------------------------------------- Modes */

.thq-modes {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 12px;
}

.thq-mode {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 16px;
	border-radius: var(--thq-radius);
	border: 1px solid var(--thq-border);
	background: var(--thq-surface);
	color: inherit;
	text-decoration: none;
	box-shadow: var(--thq-shadow);
	min-height: 64px;
}

.thq-mode--primary {
	background: linear-gradient(140deg, var(--thq-primary), var(--thq-primary-dark));
	border-color: transparent;
	color: #fff;
	box-shadow: var(--thq-shadow-lift);
}

.thq-mode--primary .thq-mode__icon {
	background: rgba(255, 255, 255, .18);
	color: #fff;
}

.thq-mode__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 12px;
	background: var(--thq-primary-light);
	color: var(--thq-primary-dark);
	flex: none;
}

.thq-mode__name {
	flex: 1;
	font-weight: 600;
	font-size: .92rem;
	line-height: 1.3;
	min-width: 0;
}

.thq-mode__go {
	color: currentColor;
	opacity: .6;
	flex: none;
}

.thq-mode--locked {
	opacity: .62;
}

/* ----------------------------------------------------------- Surah grid */

.thq-surah-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
}

.thq-surah-card {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 14px;
	border-radius: var(--thq-radius);
	border: 1px solid var(--thq-border);
	background: var(--thq-surface);
	text-decoration: none;
	color: inherit;
	box-shadow: var(--thq-shadow);
	min-width: 0;
}

.thq-surah-card__top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}

.thq-surah-card__number {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 34px;
	height: 30px;
	padding: 0 8px;
	border-radius: 9px;
	background: var(--thq-primary-light);
	color: var(--thq-primary-dark);
	font-weight: 600;
	font-size: .85rem;
}

.thq-surah-card__go {
	color: var(--thq-muted);
}

.thq-surah-card__arabic {
	font-family: 'THQ IndoPak', 'THQ Uthmanic', serif;
	font-size: 1.35rem;
	line-height: 1.9;
	margin-top: 4px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.thq-surah-card__name {
	font-weight: 600;
	font-size: .92rem;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.thq-surah-card__meta {
	font-size: .75rem;
	color: var(--thq-muted);
}

.thq-surah-card--locked {
	opacity: .68;
}

/* ----------------------------------------------------------- Surah list */

.thq-search {
	display: flex;
	align-items: center;
	gap: 8px;
	background: var(--thq-surface);
	border: 1px solid var(--thq-border);
	border-radius: 999px;
	padding: 8px 14px;
	min-width: 0;
	flex: 1 1 200px;
	max-width: 320px;
}

.thq-search__icon {
	color: var(--thq-muted);
}

.thq-search__input {
	border: 0;
	background: none;
	font: inherit;
	font-size: .85rem;
	color: inherit;
	width: 100%;
	min-width: 0;
	outline: none;
}

.thq-surah-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.thq-surah-row__inner {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 14px;
	background: var(--thq-surface);
	border: 1px solid var(--thq-border);
	border-radius: var(--thq-radius);
	text-decoration: none;
	color: inherit;
	min-width: 0;
}

.thq-surah-row.is-disabled .thq-surah-row__inner {
	opacity: .5;
}

.thq-surah-row__number {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 32px;
	height: 28px;
	border-radius: 8px;
	background: var(--thq-surface-soft);
	color: var(--thq-muted);
	font-size: .8rem;
	font-weight: 600;
	flex: none;
}

.thq-surah-row__body {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
}

.thq-surah-row__body strong {
	font-size: .9rem;
	font-weight: 600;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.thq-surah-row__body small {
	font-size: .74rem;
	color: var(--thq-muted);
}

.thq-surah-row__arabic {
	font-family: 'THQ IndoPak', 'THQ Uthmanic', serif;
	font-size: 1.15rem;
	line-height: 2;
	color: var(--thq-text);
	flex: none;
	max-width: 40%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.thq-surah-row__go {
	color: var(--thq-muted);
	flex: none;
}

/* ---------------------------------------------------------- Mode banner */

.thq-mode-banner {
	background: linear-gradient(140deg, var(--thq-primary), var(--thq-primary-dark));
	color: #fff;
	border-radius: var(--thq-radius-lg);
	padding: 20px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	box-shadow: var(--thq-shadow-lift);
}

.thq-mode-banner__eyebrow {
	font-size: .72rem;
	font-weight: 600;
	opacity: .85;
}

.thq-mode-banner__title {
	margin: 0;
	font-size: 1.2rem;
	font-weight: 700;
	line-height: 1.3;
}

.thq-mode-banner__text {
	margin: 0;
	font-size: .85rem;
	opacity: .9;
	max-width: 60ch;
}

/* ------------------------------------------------------------- Training */

.thq-training__head {
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: 12px;
}

.thq-backlink {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	color: var(--thq-muted);
	text-decoration: none;
	font-size: .82rem;
	font-weight: 500;
}

.thq-training__eyebrow {
	display: block;
	font-size: .7rem;
	color: var(--thq-muted);
	font-weight: 600;
}

.thq-training__title {
	margin: 0;
	font-size: 1.3rem;
	font-weight: 700;
	line-height: 1.2;
}

.thq-training__arabic-name {
	font-family: 'THQ IndoPak', 'THQ Uthmanic', serif;
	font-size: 1.5rem;
	line-height: 2;
}

.thq-question__meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	flex-wrap: wrap;
}

.thq-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 12px;
	border-radius: 999px;
	background: var(--thq-surface-soft);
	color: var(--thq-muted);
	font-size: .74rem;
	font-weight: 600;
}

.thq-chip--primary {
	background: var(--thq-primary-light);
	color: var(--thq-primary-dark);
}

.thq-ayah {
	font-family: 'THQ IndoPak', 'THQ Uthmanic', serif;
	font-size: var(--thq-arabic-size);
	line-height: 2.35;
	text-align: right;
	direction: rtl;
	margin: 0;
	padding: 18px 14px;
	background: var(--thq-surface-soft);
	border-radius: var(--thq-radius);
	overflow-wrap: break-word;
	word-break: normal;
}

.thq-script-uthmani .thq-ayah,
.thq-script-uthmani .thq-surah-card__arabic,
.thq-script-uthmani .thq-surah-row__arabic,
.thq-script-uthmani .thq-training__arabic-name,
.thq-script-uthmani .thq-answer__text {
	font-family: 'THQ Uthmanic', serif;
}

.thq-question__instruction {
	margin: 0;
	padding: 12px 14px;
	background: var(--thq-primary-light);
	color: var(--thq-primary-dark);
	border-radius: var(--thq-radius-sm);
	font-size: .86rem;
	font-weight: 500;
	text-align: center;
}

.thq-question__actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

/* -------------------------------------------------------------- Buttons */

.thq-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 13px 20px;
	border-radius: 999px;
	border: 1px solid transparent;
	font: inherit;
	font-size: .9rem;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	transition: background-color .15s ease, color .15s ease, border-color .15s ease;
	min-height: 46px;
	line-height: 1.2;
}

.thq-btn--block {
	width: 100%;
}

.thq-btn--primary {
	background: var(--thq-primary);
	color: #fff;
}

.thq-btn--primary:hover,
.thq-btn--primary:focus-visible {
	background: var(--thq-primary-dark);
	color: #fff;
}

.thq-btn--ghost {
	background: var(--thq-surface);
	border-color: var(--thq-border);
	color: var(--thq-text);
}

.thq-btn--soft {
	background: var(--thq-accent);
	color: var(--thq-navy);
}

.thq-btn[disabled],
.thq-btn.is-busy {
	opacity: .6;
	cursor: not-allowed;
}

.thq-app a:focus-visible,
.thq-app button:focus-visible,
.thq-app input:focus-visible,
.thq-app textarea:focus-visible,
.thq-app select:focus-visible,
.thq-app summary:focus-visible {
	outline: 3px solid var(--thq-primary);
	outline-offset: 2px;
}

/* ------------------------------------------------------------ Segmented */

.thq-segmented {
	display: flex;
	gap: 4px;
	padding: 4px;
	background: var(--thq-surface-soft);
	border-radius: 999px;
	overflow-x: auto;
}

.thq-segmented__btn {
	flex: 1 1 auto;
	border: 0;
	background: none;
	font: inherit;
	font-size: .8rem;
	font-weight: 600;
	color: var(--thq-muted);
	padding: 9px 12px;
	border-radius: 999px;
	cursor: pointer;
	white-space: nowrap;
	min-height: 40px;
}

.thq-segmented__btn.is-active {
	background: var(--thq-surface);
	color: var(--thq-primary-dark);
	box-shadow: var(--thq-shadow);
}

/* ----------------------------------------------------------- Text input */

.thq-text-input {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.thq-text-input__hint {
	margin: 0;
	font-size: .8rem;
	color: var(--thq-muted);
}

.thq-text-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-bottom: 10px;
}

.thq-text-field__label {
	font-size: .76rem;
	font-weight: 600;
	color: var(--thq-muted);
}

.thq-textarea {
	font-family: 'THQ IndoPak', 'THQ Uthmanic', serif;
	font-size: 1.25rem;
	line-height: 2.1;
	direction: rtl;
	text-align: right;
	width: 100%;
	min-height: 76px;
	padding: 10px 12px;
	border: 1px solid var(--thq-border);
	border-radius: var(--thq-radius-sm);
	background: var(--thq-surface);
	color: var(--thq-text);
	resize: vertical;
}

/* ------------------------------------------------------------- Recorder */

.thq-recorder {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	text-align: center;
}

.thq-recorder__hint,
.thq-recorder__note {
	margin: 0;
	font-size: .8rem;
	color: var(--thq-muted);
	max-width: 46ch;
}

.thq-mic {
	position: relative;
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	width: 148px;
	height: 148px;
	border-radius: 50%;
	border: 0;
	cursor: pointer;
	background: radial-gradient(circle at 50% 40%, var(--thq-primary), var(--thq-primary-dark));
	color: #fff;
	font: inherit;
	font-weight: 600;
	font-size: .82rem;
	box-shadow: var(--thq-shadow-lift);
}

.thq-mic .thq-icon {
	width: 34px;
	height: 34px;
}

.thq-mic__ring {
	position: absolute;
	inset: -10px;
	border-radius: 50%;
	border: 3px solid var(--thq-primary-light);
	opacity: 0;
}

.thq-mic.is-recording .thq-mic__ring {
	opacity: 1;
	animation: thq-pulse 1.6s ease-out infinite;
}

@keyframes thq-pulse {
	0% { transform: scale(1); opacity: .9; }
	100% { transform: scale(1.18); opacity: 0; }
}

.thq-recorder__timer {
	margin: 0;
	font-variant-numeric: tabular-nums;
	font-weight: 600;
	color: var(--thq-muted);
}

.thq-recorder__fallback {
	width: 100%;
	font-size: .8rem;
	color: var(--thq-muted);
}

.thq-recorder__fallback summary {
	cursor: pointer;
	padding: 6px 0;
}

/* --------------------------------------------------------------- Reveal */

.thq-reveal__title {
	margin: 0;
	font-size: 1rem;
	font-weight: 600;
}

.thq-reveal__hint {
	margin: 0;
	font-size: .8rem;
	color: var(--thq-muted);
}

.thq-reveal__list,
.thq-answer-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.thq-reveal-item {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 12px;
	border: 1px solid var(--thq-border);
	border-radius: var(--thq-radius-sm);
	background: var(--thq-surface-soft);
}

.thq-reveal-item__number {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 28px;
	height: 26px;
	border-radius: 8px;
	background: var(--thq-surface);
	border: 1px solid var(--thq-border);
	font-size: .76rem;
	font-weight: 600;
	color: var(--thq-muted);
	flex: none;
}

.thq-reveal-item__text {
	flex: 1;
	min-width: 0;
	font-family: 'THQ IndoPak', 'THQ Uthmanic', serif;
	font-size: calc(var(--thq-arabic-size) * .82);
	line-height: 2.2;
	direction: rtl;
	text-align: right;
	overflow-wrap: break-word;
}

.thq-mark-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: 1px solid var(--thq-border);
	background: var(--thq-surface);
	cursor: pointer;
	color: var(--thq-muted);
	flex: none;
}

.thq-mark-toggle.is-correct {
	background: var(--thq-primary);
	border-color: var(--thq-primary);
	color: #fff;
}

.thq-mark-toggle.is-wrong {
	background: var(--thq-danger);
	border-color: var(--thq-danger);
	color: #fff;
}

/* -------------------------------------------------------------- Results */

.thq-verdict {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 8px;
	padding: 26px 18px;
	background: var(--thq-surface);
	border: 1px solid var(--thq-border);
	border-radius: var(--thq-radius-lg);
	box-shadow: var(--thq-shadow);
}

.thq-verdict__badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 62px;
	height: 62px;
	border-radius: 50%;
	background: var(--thq-primary);
	color: #fff;
}

.thq-verdict--warning .thq-verdict__badge {
	background: var(--thq-warning);
}

.thq-verdict__title {
	margin: 0;
	font-size: 1.4rem;
	font-weight: 700;
}

.thq-verdict__text {
	margin: 0;
	color: var(--thq-muted);
	font-size: .88rem;
}

.thq-scoreboard {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px;
	background: var(--thq-surface);
	border: 1px solid var(--thq-border);
	border-radius: var(--thq-radius);
	padding: 16px;
	text-align: center;
	box-shadow: var(--thq-shadow);
}

.thq-scoreboard__item strong {
	display: block;
	font-size: 1.3rem;
	font-weight: 700;
	line-height: 1.2;
}

.thq-scoreboard__item span {
	font-size: .74rem;
	color: var(--thq-muted);
}

.thq-answer {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 12px;
	border: 1px solid var(--thq-border);
	border-radius: var(--thq-radius-sm);
	background: var(--thq-surface-soft);
}

.thq-answer__number {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 28px;
	height: 26px;
	border-radius: 8px;
	background: var(--thq-surface);
	border: 1px solid var(--thq-border);
	font-size: .76rem;
	font-weight: 600;
	color: var(--thq-muted);
	flex: none;
}

.thq-answer__text {
	flex: 1;
	min-width: 0;
	font-family: 'THQ IndoPak', 'THQ Uthmanic', serif;
	font-size: calc(var(--thq-arabic-size) * .78);
	line-height: 2.2;
	direction: rtl;
	text-align: right;
	overflow-wrap: break-word;
}

.thq-answer__mark {
	flex: none;
	color: var(--thq-primary);
}

.thq-answer--incorrect .thq-answer__mark,
.thq-answer--omitted .thq-answer__mark {
	color: var(--thq-danger);
}

.thq-results__meta {
	margin: 0;
	text-align: center;
	font-size: .78rem;
	color: var(--thq-muted);
}

/* ---------------------------------------------------------- AI feedback */

.thq-ai-panel {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 14px;
	border-radius: var(--thq-radius);
	background: var(--thq-surface-soft);
	border: 1px solid var(--thq-border);
}

.thq-ai-panel__title {
	margin: 0;
	font-size: .9rem;
	font-weight: 600;
}

.thq-ai-row {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: .82rem;
}

.thq-ai-row__status {
	display: inline-flex;
	align-items: center;
	padding: 3px 10px;
	border-radius: 999px;
	font-size: .72rem;
	font-weight: 600;
}

.thq-ai-row__status--good {
	background: var(--thq-primary-light);
	color: var(--thq-primary-dark);
}

.thq-ai-row__status--warning {
	background: #fdf1dc;
	color: var(--thq-warning);
}

.thq-ai-row__status--missing {
	background: #fbe3e0;
	color: var(--thq-danger);
}

.thq-ai-transcript {
	font-family: 'THQ IndoPak', 'THQ Uthmanic', serif;
	direction: rtl;
	text-align: right;
	font-size: 1.1rem;
	line-height: 2;
	margin: 0;
	color: var(--thq-muted);
}

/* -------------------------------------------------------------- Records */

.thq-record-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.thq-record {
	background: var(--thq-surface);
	border: 1px solid var(--thq-border);
	border-radius: var(--thq-radius);
}

.thq-record__link,
.thq-record:not(:has(.thq-record__link)) {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 14px;
	text-decoration: none;
	color: inherit;
}

.thq-record__surah {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.thq-record__surah strong {
	font-size: .9rem;
	font-weight: 600;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.thq-record__surah small {
	font-size: .74rem;
	color: var(--thq-muted);
}

.thq-score {
	font-weight: 700;
	font-size: .9rem;
	flex: none;
	padding: 4px 10px;
	border-radius: 999px;
}

.thq-score--good {
	background: var(--thq-primary-light);
	color: var(--thq-primary-dark);
}

.thq-score--mid {
	background: #fdf1dc;
	color: var(--thq-warning);
}

.thq-score--low {
	background: #fbe3e0;
	color: var(--thq-danger);
}

/* ------------------------------------------------------------- Progress */

.thq-average {
	flex-direction: row;
	align-items: center;
	gap: 14px;
}

.thq-average__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	border-radius: 14px;
	background: var(--thq-primary-light);
	color: var(--thq-primary-dark);
	flex: none;
}

.thq-average__label {
	display: block;
	font-size: .78rem;
	color: var(--thq-muted);
}

.thq-average__value {
	font-size: 1.6rem;
	font-weight: 700;
	line-height: 1.1;
}

.thq-progress-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
	counter-reset: none;
}

.thq-progress-row {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 14px;
	background: var(--thq-surface);
	border: 1px solid var(--thq-border);
	border-radius: var(--thq-radius);
}

.thq-progress-row__rank {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 8px;
	background: var(--thq-surface-soft);
	color: var(--thq-muted);
	font-size: .78rem;
	font-weight: 600;
	flex: none;
}

.thq-progress-row__body {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.thq-progress-row__body strong {
	font-size: .9rem;
	font-weight: 600;
}

.thq-progress-row__body small {
	font-size: .74rem;
	color: var(--thq-muted);
}

.thq-progress-row__value {
	font-weight: 700;
	font-size: .88rem;
	flex: none;
}

.thq-meter {
	display: block;
	height: 6px;
	border-radius: 999px;
	background: var(--thq-surface-soft);
	overflow: hidden;
}

.thq-meter__fill {
	display: block;
	height: 100%;
	border-radius: 999px;
	background: var(--thq-primary);
}

/* ----------------------------------------------------------------- Plan */

.thq-plan-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 12px;
}

.thq-plan {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 18px;
	background: var(--thq-surface);
	border: 1px solid var(--thq-border);
	border-radius: var(--thq-radius);
	box-shadow: var(--thq-shadow);
}

.thq-plan--current {
	border-color: var(--thq-primary);
}

.thq-plan__name {
	margin: 0;
	font-size: 1.05rem;
	font-weight: 700;
}

.thq-plan__price {
	margin: 0;
	display: flex;
	align-items: baseline;
	gap: 6px;
}

.thq-plan__price strong {
	font-size: 1.4rem;
	font-weight: 700;
}

.thq-plan__price span {
	font-size: .78rem;
	color: var(--thq-muted);
}

.thq-plan__desc {
	margin: 0;
	font-size: .84rem;
	color: var(--thq-muted);
}

.thq-plan__features {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
	font-size: .84rem;
}

.thq-plan__features li {
	padding-left: 22px;
	position: relative;
}

.thq-plan__features li::before {
	content: '';
	position: absolute;
	left: 0;
	top: .45em;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: var(--thq-primary-light);
}

.thq-plan__features li.is-off {
	color: var(--thq-muted);
}

.thq-plan__features li.is-off::before {
	background: var(--thq-surface-soft);
}

.thq-plan-current {
	gap: 6px;
}

.thq-plan-current__label {
	font-size: .78rem;
	color: var(--thq-muted);
}

.thq-plan-current__name {
	font-size: 1.25rem;
	font-weight: 700;
}

.thq-plan-current__meta {
	font-size: .82rem;
	color: var(--thq-muted);
}

.thq-payment-status {
	display: block;
	font-style: normal;
	font-size: .7rem;
	font-weight: 600;
	color: var(--thq-muted);
	text-align: right;
}

.thq-payment-status--paid {
	color: var(--thq-primary-dark);
}

.thq-payment-status--failed,
.thq-payment-status--cancelled {
	color: var(--thq-danger);
}

/* --------------------------------------------------------------- Badges */

.thq-badge {
	display: inline-flex;
	align-items: center;
	align-self: flex-start;
	padding: 4px 11px;
	border-radius: 999px;
	font-size: .72rem;
	font-weight: 600;
	background: var(--thq-surface-soft);
	color: var(--thq-muted);
}

.thq-badge--success {
	background: var(--thq-primary-light);
	color: var(--thq-primary-dark);
}

.thq-badge--soft {
	background: var(--thq-accent);
	color: var(--thq-navy);
}

/* ------------------------------------------------------- Forms & fields */

.thq-form {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.thq-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	border: 0;
	padding: 0;
	margin: 0;
}

.thq-field__label {
	font-size: .8rem;
	font-weight: 600;
	color: var(--thq-text);
}

.thq-field__hint {
	font-size: .74rem;
	color: var(--thq-muted);
}

.thq-input {
	width: 100%;
	padding: 12px 14px;
	border: 1px solid var(--thq-border);
	border-radius: var(--thq-radius-sm);
	background: var(--thq-surface);
	font: inherit;
	font-size: .9rem;
	color: var(--thq-text);
	min-height: 46px;
}

.thq-input:disabled {
	background: var(--thq-surface-soft);
	color: var(--thq-muted);
}

.thq-range {
	width: 100%;
	accent-color: var(--thq-primary);
}

.thq-checkbox {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: .84rem;
}

.thq-radio-cards {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 10px;
}

.thq-radio-card {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 14px;
	border: 1px solid var(--thq-border);
	border-radius: var(--thq-radius-sm);
	background: var(--thq-surface);
	cursor: pointer;
}

.thq-radio-card:has(input:checked) {
	border-color: var(--thq-primary);
	background: var(--thq-primary-light);
}

.thq-radio-card__body {
	display: flex;
	flex-direction: column;
}

.thq-radio-card__body strong {
	font-size: .88rem;
	font-weight: 600;
}

.thq-radio-card__body small {
	font-size: .74rem;
	color: var(--thq-muted);
}

.thq-ayah--sample {
	font-size: var(--thq-arabic-size);
}

/* ----------------------------------------------------------------- Auth */

.thq-auth {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 28px 16px;
	min-height: 60vh;
}

.thq-auth__panel {
	width: 100%;
	max-width: 420px;
	background: var(--thq-surface);
	border: 1px solid var(--thq-border);
	border-radius: var(--thq-radius-lg);
	padding: 26px 22px;
	box-shadow: var(--thq-shadow);
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.thq-auth__brand {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 8px;
}

.thq-auth__title {
	margin: 0;
	font-size: 1.2rem;
	font-weight: 700;
}

.thq-auth__tagline {
	margin: 0;
	font-size: .8rem;
	color: var(--thq-muted);
}

.thq-auth__heading {
	margin: 0;
	font-size: 1.05rem;
	font-weight: 600;
	text-align: center;
}

.thq-auth__lead {
	margin: 0;
	font-size: .84rem;
	color: var(--thq-muted);
	text-align: center;
}

.thq-auth__switch {
	margin: 0;
	text-align: center;
	font-size: .82rem;
	color: var(--thq-muted);
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
}

.thq-auth__switch a {
	color: var(--thq-primary);
	font-weight: 600;
	text-decoration: none;
}

/* -------------------------------------------------------- Notices, misc */

.thq-notice {
	padding: 14px 16px;
	border-radius: var(--thq-radius);
	border: 1px solid var(--thq-border);
	background: var(--thq-surface);
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.thq-notice--success {
	background: var(--thq-primary-light);
	border-color: transparent;
}

.thq-notice--warning {
	background: #fdf1dc;
	border-color: transparent;
}

.thq-notice--danger {
	background: #fbe3e0;
	border-color: transparent;
}

.thq-notice__title {
	font-size: .9rem;
	font-weight: 600;
}

.thq-notice__text {
	margin: 0;
	font-size: .84rem;
	color: var(--thq-text);
}

.thq-alert {
	padding: 12px 14px;
	border-radius: var(--thq-radius-sm);
	background: #fbe3e0;
	color: var(--thq-danger);
	font-size: .84rem;
	font-weight: 500;
}

.thq-alert--info {
	background: var(--thq-primary-light);
	color: var(--thq-primary-dark);
}

.thq-empty,
.thq-loading {
	margin: 0;
	padding: 22px 14px;
	text-align: center;
	color: var(--thq-muted);
	font-size: .86rem;
}

.thq-avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: var(--thq-primary);
	color: #fff;
	font-weight: 600;
	flex: none;
	text-transform: uppercase;
}

/* ---------------------------------------------------------- Breakpoints */

@media (min-width: 600px) {
	.thq-main {
		padding: 24px 24px 96px;
	}

	.thq-stats {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}

	.thq-surah-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.thq-modes {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.thq-plan-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.thq-radio-cards {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.thq-question__actions {
		flex-direction: row;
		flex-wrap: wrap;
	}

	.thq-question__actions .thq-btn {
		flex: 1 1 200px;
		width: auto;
	}
}

@media (min-width: 1024px) {
	.thq-app {
		display: grid;
		grid-template-columns: 258px minmax(0, 1fr);
		grid-template-areas: 'sidebar main';
		background: var(--thq-background);
	}

	.thq-app--bare {
		display: block;
	}

	.thq-topbar,
	.thq-tabbar {
		display: none;
	}

	.thq-sidebar {
		grid-area: sidebar;
		display: flex;
		flex-direction: column;
		gap: 22px;
		padding: 22px 16px;
		background: var(--thq-navy);
		color: #fff;
		min-height: 100%;
	}

	.thq-main {
		grid-area: main;
		padding: 28px 30px 40px;
	}

	.thq-brand {
		display: flex;
		align-items: center;
		gap: 10px;
	}

	.thq-brand__text {
		font-size: .92rem;
		font-weight: 600;
		line-height: 1.25;
	}

	.thq-nav {
		display: flex;
		flex-direction: column;
		gap: 4px;
		flex: 1;
	}

	.thq-nav__item {
		display: flex;
		align-items: center;
		gap: 11px;
		padding: 11px 13px;
		border-radius: var(--thq-radius-sm);
		color: rgba(255, 255, 255, .74);
		text-decoration: none;
		font-size: .87rem;
		font-weight: 500;
	}

	.thq-nav__item:hover {
		background: var(--thq-navy-soft);
		color: #fff;
	}

	.thq-nav__item.is-active {
		background: var(--thq-primary);
		color: #fff;
		font-weight: 600;
	}

	.thq-sidebar__user {
		display: flex;
		align-items: center;
		gap: 10px;
		padding: 12px;
		border-radius: var(--thq-radius);
		background: var(--thq-navy-soft);
	}

	.thq-sidebar__user-meta {
		flex: 1;
		min-width: 0;
	}

	.thq-sidebar__user-meta strong {
		display: block;
		font-size: .84rem;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	.thq-sidebar__user-meta small {
		display: block;
		font-size: .72rem;
		color: rgba(255, 255, 255, .6);
	}

	.thq-sidebar__logout {
		color: rgba(255, 255, 255, .7);
		text-decoration: none;
		flex: none;
	}

	.thq-hero {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		padding: 26px 28px;
	}

	.thq-hero__streak {
		flex: none;
		min-width: 240px;
	}

	.thq-surah-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}

	.thq-plan-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.thq-page {
		max-width: 1000px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.thq-app *,
	.thq-app *::before,
	.thq-app *::after {
		animation-duration: .001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .001ms !important;
	}
}
