/**
 * DailyStep Quiz — Frontend Styles
 *
 * Theming:
 *   --dsq-accent — pulled from Kadence's primary palette (--global-palette1)
 *                  with WordPress core blue fallback.
 *   --dsq-audio  — yellow play-button colour (matches Audio Vocab Quiz).
 *
 * Per-quiz override: add inline style="--dsq-accent: #colour" to the
 * shortcode's wrapper, or scope a CSS rule by the wrapper's id.
 *
 * Accessibility:
 *   - prefers-reduced-motion disables transitions and shake animations.
 *   - All interactive elements have :focus-visible outlines.
 *   - Match mode uses both colour AND a halo for selected state.
 *   - Streak indicator uses both colour AND emoji + text.
 */

.dsq-quiz {
	--dsq-accent: var( --global-palette1, #2271b1 );
	--dsq-accent-contrast: #ffffff;
	--dsq-correct: #16a34a;
	--dsq-wrong: #dc2626;
	--dsq-amber: #ca8a04;
	--dsq-audio: #fece00;
	--dsq-muted: #6b7280;

	font-family: inherit;
	max-width: 720px;
	margin: 1.5rem auto;
	padding: 1.5rem;
	border: 2px solid var( --dsq-accent );
	border-radius: 8px;
	background: #ffffff;
	color: #1a1a1a;
	box-sizing: border-box;
}

.dsq-quiz *,
.dsq-quiz *::before,
.dsq-quiz *::after {
	box-sizing: border-box;
}

/* ============================================================
   States
   ============================================================ */

.dsq-quiz__data {
	display: none;
}

.dsq-quiz__loading {
	margin: 0;
	text-align: center;
	color: var( --dsq-muted );
	font-size: 0.95rem;
}

.dsq-quiz--error .dsq-error {
	margin: 0;
	padding: 0.75rem 1rem;
	background: #fef2f2;
	border-left: 4px solid var( --dsq-wrong );
	border-radius: 0 4px 4px 0;
	color: #7f1d1d;
	font-size: 0.95rem;
	line-height: 1.5;
}

/* ============================================================
   Header (progress + streak)
   ============================================================ */

.dsq-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
	margin-bottom: 1.25rem;
	padding-bottom: 0.75rem;
	border-bottom: 1px solid #e5e7eb;
	font-size: 0.875rem;
	color: var( --dsq-muted );
	flex-wrap: wrap;
}

.dsq-progress {
	font-weight: 500;
}

.dsq-streak {
	font-weight: 600;
	color: var( --dsq-amber );
}

.dsq-streak[hidden] {
	display: none;
}

/* ============================================================
   Passage block (stimulus: reading text and/or audio)
   ============================================================ */

/* v1.23.0 — the 4px accent stripe down the left was removed: on a phone it
   ate width that the text needed, and the box's own background already
   marks it out as the passage. Padding is trimmed to match. */
.dsq-passage {
	margin: 0 0 1.25rem 0;
	padding: 0.9rem 1rem;
	background: #eef3fc;
	border: 1px solid rgba( 0, 0, 0, 0.08 );
	border-radius: 8px;
	text-align: left;
}

/* The text sits flush to the box's padding — no inner width limit. */
.dsq-passage__body {
	width: 100%;
}

.dsq-passage__text {
	margin: 0 0 0.55rem 0;
	font-size: 1rem;
	line-height: 1.55;
	color: #1a1a1a;
}

.dsq-passage__text:last-child {
	margin-bottom: 0;
}

/* v1.23.0 — follow-along transcript. Each sentence is tappable ("play from
   here") and the one being spoken is highlighted. The highlight is a
   background colour rather than a box-shadow halo, because these are inline
   spans that wrap across lines: a halo would break at every line end. */
.dsq-passage__sent {
	cursor: pointer;
	border-radius: 3px;
	padding: 0.05em 0.1em;
	margin: 0 -0.1em;
	transition: background 0.15s ease;
}

.dsq-passage__sent:hover {
	background: rgba( 254, 206, 0, 0.30 );
}

.dsq-passage__sent:focus-visible {
	outline: 2px solid var( --dsq-accent );
	outline-offset: 2px;
}

.dsq-passage__sent.dsq-is-speaking {
	background: #FFFF00;
}

/* Passage audio — a thin horizontal DailyStep-yellow player above the text. */
.dsq-passage-audio {
	margin: 0 0 0.85rem 0;
}

.dsq-audioplayer {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	margin: 0 0 0.85rem 0;
}

.dsq-audioplayer__btn {
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
	border: none;
	border-radius: 50%;
	background: var( --dsq-audio );
	color: #ffffff;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	-webkit-appearance: none;
	appearance: none;
	box-shadow: 0 1px 3px rgba( 0, 0, 0, 0.18 );
}

.dsq-audioplayer__btn svg {
	width: 20px;
	height: 20px;
}

/* "Start again" — rewinds to the beginning and plays from the top. Drawn
   as an outline button so it reads as secondary to the play control. */
.dsq-audioplayer__again {
	flex: 0 0 auto;
	width: 32px;
	height: 32px;
	border: 2px solid var( --dsq-audio );
	border-radius: 50%;
	background: #ffffff;
	color: var( --dsq-audio );
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	-webkit-appearance: none;
	appearance: none;
}

.dsq-audioplayer__again:hover {
	background: var( --dsq-audio );
	color: #ffffff;
}

.dsq-audioplayer__again svg {
	width: 18px;
	height: 18px;
}

.dsq-audioplayer__bar {
	flex: 1 1 auto;
	min-width: 100px;
	height: 8px;
	border-radius: 4px;
	background: rgba( 0, 0, 0, 0.12 );
	position: relative;
	cursor: pointer;
	/* Stops the page scrolling while the learner drags the handle. */
	touch-action: none;
}

/* Invisible padding above and below the 8 px track, so the drag target is
   comfortable on a phone without making the bar look thick. */
.dsq-audioplayer__bar::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: -11px;
	bottom: -11px;
}

.dsq-audioplayer__bar:focus-visible {
	outline: 2px solid var( --dsq-accent );
	outline-offset: 4px;
}

.dsq-audioplayer__fill {
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 0;
	border-radius: 4px;
	background: var( --dsq-audio );
}

/* The draggable handle. pointer-events are off so every pointer event is
   handled by the track itself, whatever is under the finger. */
.dsq-audioplayer__knob {
	position: absolute;
	top: 50%;
	left: 0;
	width: 16px;
	height: 16px;
	margin: -8px 0 0 -8px;
	border-radius: 50%;
	background: #ffffff;
	border: 2px solid var( --dsq-audio );
	box-shadow: 0 1px 3px rgba( 0, 0, 0, 0.25 );
	pointer-events: none;
}

.dsq-audioplayer__time {
	flex: 0 0 auto;
	font-size: 0.8rem;
	color: var( --dsq-muted );
	font-variant-numeric: tabular-nums;
}

/* Answer audio — an optional recording of the correct answer, shown up
   front as a scaffold (when="before"/"both") and/or revealed with the
   feedback (when="after"/"both"). Reuses the .dsq-audioplayer widget. */
.dsq-answer-audio {
	margin: 0.6rem 0 0.85rem 0;
}

.dsq-answer-audio__label {
	display: block;
	font-size: 0.85rem;
	font-weight: 600;
	color: var( --dsq-muted );
	margin: 0 0 0.35rem 0;
}

.dsq-answer-audio .dsq-audioplayer {
	margin: 0;
}

/* v1.22.0 — the words of the clip, printed under its player. Replaces the
   label, so it carries the weight the label used to: slightly larger than
   body text and semibold, matching .dsq-answer-replay__answer. */
.dsq-answer-audio__caption {
	margin: 0.4rem 0 0 0;
	font-weight: 600;
	line-height: 1.4;
}

/* Answer replay (multiple-choice) — the correct option repeated on its own
   line under the prompt, with one player that runs the question clip then
   the answer clip. */
.dsq-answer-replay {
	margin: 0 0 1.25rem 0;
	padding: 0.75rem 0.9rem;
	border-radius: 8px;
	background: rgba( 254, 206, 0, 0.10 );
}

.dsq-answer-replay__label {
	display: block;
	font-size: 0.85rem;
	font-weight: 600;
	color: var( --dsq-muted );
	margin: 0 0 0.35rem 0;
}

.dsq-answer-replay__answer {
	margin: 0 0 0.6rem 0;
	font-weight: 600;
	line-height: 1.4;
}

.dsq-answer-replay .dsq-audioplayer {
	margin: 0;
}

/* The line currently sounding. Applied to the prompt while the question
   clip plays, then to the answer line while the answer clip plays. */
.dsq-is-sounding {
	background: rgba( 254, 206, 0, 0.55 );
	box-shadow: 0 0 0 4px rgba( 254, 206, 0, 0.55 );
	border-radius: 3px;
	transition: background 0.15s ease;
}

/* "Listen first": collapse the passage text behind a toggle. */
.dsq-passage-toggle {
	display: inline-block;
	margin: 0 0 0.5rem 0;
	padding: 0.3rem 0.8rem;
	border: 2px solid var( --dsq-accent );
	border-radius: 999px;
	background: #fff;
	color: var( --dsq-accent );
	font: inherit;
	font-weight: 600;
	font-size: 0.85rem;
	cursor: pointer;
}

.dsq-passage-toggle:hover {
	background: var( --dsq-accent );
	color: var( --dsq-accent-contrast );
}

.dsq-passage__body--collapsed {
	display: none;
}

/* The answer the learner must form a question for, shown highlighted. */
.dsq-answer-cue {
	margin: -0.6rem 0 1.25rem 0;
	font-size: 1.1rem;
	font-weight: 700;
	line-height: 1.4;
	text-align: center;
	color: var( --dsq-answer-cue, #1d4ed8 );
}

/* ============================================================
   Prompt block (used by all modes)
   ============================================================ */

.dsq-prompt {
	margin: 0 0 1.25rem 0;
	font-size: 1.1rem;
	font-weight: 500;
	line-height: 1.4;
	text-align: center;
}

.dsq-prompt-image {
	display: block;
	max-width: 280px;
	max-height: 200px;
	margin: 0 auto 1rem auto;
	border-radius: 6px;
	object-fit: contain;
}

.dsq-prompt-audio {
	display: flex;
	justify-content: center;
	margin: 0 0 1.25rem 0;
}

.dsq-audio-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	border: none;
	border-radius: 50%;
	background: var( --dsq-audio );
	color: #ffffff;
	cursor: pointer;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
	box-shadow: 0 2px 4px rgba( 0, 0, 0, 0.1 );
}

.dsq-audio-btn:hover:not(:disabled) {
	transform: scale( 1.05 );
	box-shadow: 0 4px 8px rgba( 0, 0, 0, 0.15 );
}

.dsq-audio-btn:active:not(:disabled) {
	transform: scale( 0.98 );
}

.dsq-audio-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.dsq-audio-btn svg {
	width: 34px;
	height: 34px;
	fill: currentColor;
}

.dsq-audio-btn[data-state="playing"] {
	animation: dsq-pulse 1s ease-in-out infinite;
}

@keyframes dsq-pulse {
	0%, 100% { box-shadow: 0 2px 4px rgba( 0, 0, 0, 0.1 ); }
	50%      { box-shadow: 0 0 0 8px rgba( 254, 206, 0, 0.25 ); }
}

/* ============================================================
   Multiple-choice mode
   ============================================================ */

.dsq-options {
	display: grid;
	grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
	gap: 0.75rem;
}

.dsq-options--single-col {
	grid-template-columns: 1fr;
}

.dsq-tile {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 64px;
	padding: 0.875rem 1rem;
	border: 2px solid var( --dsq-accent );
	border-radius: 8px;
	background: #ffffff;
	color: var( --dsq-accent );
	font-family: inherit;
	font-size: 1rem;
	font-weight: 500;
	cursor: pointer;
	text-align: center;
	line-height: 1.3;
	transition: background-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
	word-break: break-word;
}

.dsq-tile:hover:not(:disabled) {
	background: var( --dsq-accent );
	color: var( --dsq-accent-contrast );
	transform: translateY( -1px );
}

.dsq-tile:disabled {
	cursor: not-allowed;
}

.dsq-tile--image {
	flex-direction: column;
	padding: 0.5rem;
	min-height: 140px;
}

.dsq-tile--image img {
	max-width: 100%;
	max-height: 120px;
	object-fit: contain;
	border-radius: 4px;
}

.dsq-tile--correct {
	background: var( --dsq-correct );
	border-color: var( --dsq-correct );
	color: #ffffff;
}

.dsq-tile--wrong {
	background: var( --dsq-wrong );
	border-color: var( --dsq-wrong );
	color: #ffffff;
	animation: dsq-shake 0.4s ease;
}

.dsq-tile--reveal {
	background: var( --dsq-correct );
	border-color: var( --dsq-correct );
	color: #ffffff;
	opacity: 0.8;
}

@keyframes dsq-shake {
	0%, 100%   { transform: translateX( 0 ); }
	25%        { transform: translateX( -4px ); }
	75%        { transform: translateX( 4px ); }
}

/* ============================================================
   Match mode
   ============================================================ */

.dsq-match-grid {
	display: grid;
	grid-template-columns: repeat( 4, minmax( 0, 1fr ) );
	gap: 0.5rem;
}

.dsq-match-tile {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 90px;
	padding: 0.5rem;
	border: 2px solid var( --dsq-accent );
	border-radius: 8px;
	background: #ffffff;
	color: var( --dsq-accent );
	font-family: inherit;
	font-size: 0.95rem;
	font-weight: 500;
	cursor: pointer;
	text-align: center;
	line-height: 1.3;
	transition: background-color 0.15s ease, color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
	word-break: break-word;
}

.dsq-match-tile img {
	max-width: 100%;
	max-height: 76px;
	object-fit: contain;
}

.dsq-match-tile:hover:not(:disabled):not(.dsq-match-tile--matched) {
	background: var( --dsq-accent );
	color: var( --dsq-accent-contrast );
}

.dsq-match-tile:hover:not(:disabled):not(.dsq-match-tile--matched) img {
	filter: brightness( 1.1 );
}

.dsq-match-tile--selected {
	box-shadow: 0 0 0 4px rgba( 34, 113, 177, 0.25 );
	background: var( --dsq-accent );
	color: var( --dsq-accent-contrast );
}

.dsq-match-tile--matched {
	background: var( --dsq-correct );
	border-color: var( --dsq-correct );
	color: #ffffff;
	cursor: default;
	opacity: 0.85;
}

.dsq-match-tile--wrong {
	background: var( --dsq-wrong );
	border-color: var( --dsq-wrong );
	color: #ffffff;
	animation: dsq-shake 0.4s ease;
}

/* ============================================================
   Fill-in-the-blanks mode
   ============================================================ */

.dsq-fill {
	text-align: center;
}

.dsq-sentence {
	font-size: 1.15rem;
	line-height: 1.9;
	margin: 0 0 1.5rem 0;
}

.dsq-blank {
	display: inline-block;
	min-width: 6em;
	padding: 0.3rem 0.6rem;
	margin: 0 0.4rem;
	border: 0;
	border-bottom: 2px solid var( --dsq-accent );
	background: transparent;
	font-family: inherit;
	font-size: inherit;
	font-weight: 500;
	color: var( --dsq-accent );
	text-align: center;
	outline: none;
}

.dsq-blank:focus {
	border-bottom-width: 3px;
}

.dsq-blank--correct {
	color: var( --dsq-correct );
	border-bottom-color: var( --dsq-correct );
}

.dsq-blank--wrong {
	color: var( --dsq-wrong );
	border-bottom-color: var( --dsq-wrong );
	animation: dsq-shake 0.4s ease;
}

.dsq-fill-actions {
	display: flex;
	justify-content: center;
	gap: 0.75rem;
	margin-top: 1rem;
	flex-wrap: wrap;
}

.dsq-feedback {
	margin: 1rem 0 0 0;
	min-height: 1.5em;
	font-size: 0.95rem;
	font-weight: 500;
}

.dsq-feedback--correct { color: var( --dsq-correct ); }
.dsq-feedback--wrong   { color: var( --dsq-wrong ); }
.dsq-feedback--hint    { color: var( --dsq-amber ); }

/* ============================================================
   Buttons (Submit, Next, Try Again)
   ============================================================ */

.dsq-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 0.5rem 1.25rem;
	border: 2px solid var( --dsq-accent );
	border-radius: 6px;
	background: var( --dsq-accent );
	color: var( --dsq-accent-contrast );
	font-family: inherit;
	font-size: 0.95rem;
	font-weight: 600;
	cursor: pointer;
	transition: opacity 0.15s ease, transform 0.1s ease;
}

.dsq-btn:hover:not(:disabled) {
	opacity: 0.9;
	transform: translateY( -1px );
}

.dsq-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.dsq-btn--secondary {
	background: #ffffff;
	color: var( --dsq-accent );
}

.dsq-btn--secondary:hover:not(:disabled) {
	background: var( --dsq-accent );
	color: var( --dsq-accent-contrast );
	opacity: 1;
}

.dsq-actions {
	display: flex;
	justify-content: center;
	gap: 0.75rem;
	margin-top: 1.5rem;
	flex-wrap: wrap;
}

/* ============================================================
   Summary screen
   ============================================================ */

.dsq-summary {
	text-align: center;
	padding: 1rem 0;
}

.dsq-summary__title {
	margin: 0 0 0.5rem 0;
	font-size: 1.5rem;
	font-weight: 700;
	color: var( --dsq-accent );
}

.dsq-summary__score {
	margin: 0 0 0.5rem 0;
	font-size: 2.25rem;
	font-weight: 700;
	color: #1a1a1a;
}

.dsq-summary__score-divider {
	color: var( --dsq-muted );
	font-weight: 400;
}

.dsq-summary__streak {
	margin: 0 0 1.25rem 0;
	font-size: 0.95rem;
	color: var( --dsq-amber );
	font-weight: 600;
}

.dsq-summary__streak[hidden] {
	display: none;
}

/* Configurable end-screen band + link buttons. */
.dsq-summary__band {
	margin: 0 0 1rem 0;
	font-size: 1rem;
	line-height: 1.5;
}

.dsq-end-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	justify-content: center;
	margin: 0 0 1.25rem 0;
}

.dsq-end-link {
	text-decoration: none;
}

/* Start screen. */
.dsq-start {
	text-align: center;
}

.dsq-start__title {
	margin: 0 0 0.75rem 0;
	font-size: 1.3rem;
	font-weight: 700;
}

.dsq-start__text {
	margin: 0 auto 0.75rem auto;
	max-width: 46ch;
	font-size: 1rem;
	line-height: 1.55;
}

.dsq-start__video {
	display: block;
	width: 100%;
	max-width: 640px;
	margin: 1rem auto;
	border-radius: 8px;
}

.dsq-start__embed {
	position: relative;
	width: 100%;
	max-width: 640px;
	margin: 1rem auto;
	padding-top: 56.25%; /* 16:9 */
	height: 0;
}

.dsq-start__embed iframe {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border: 0;
	border-radius: 8px;
}

/* ============================================================
   Focus visibility
   ============================================================ */

.dsq-quiz button:focus-visible,
.dsq-quiz input:focus-visible {
	outline: 3px solid rgba( 34, 113, 177, 0.5 );
	outline-offset: 2px;
}

/* ============================================================
   Responsive
   ============================================================ */

@media ( max-width: 540px ) {
	/* v1.23.0 — the quiz box, the passage box and the theme's own content
	   padding were stacking up to roughly 2rem of chrome each side, leaving
	   a very narrow column of text on a phone. Both boxes are trimmed here,
	   and the outer margin is reduced so the quiz sits closer to the edge. */
	.dsq-quiz {
		padding: 0.75rem;
		margin: 1rem auto;
	}

	.dsq-passage {
		padding: 0.75rem;
	}

	.dsq-audioplayer {
		gap: 0.5rem;
	}

	.dsq-options {
		grid-template-columns: 1fr;
	}

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

	.dsq-prompt {
		font-size: 1rem;
	}

	.dsq-sentence {
		font-size: 1.05rem;
	}

	.dsq-summary__score {
		font-size: 1.75rem;
	}
}

/* ============================================================
   Reduced motion
   ============================================================ */

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

/* ============================================================
   v1.7.0 — course pass/fail outcome on the summary screen
   Shown only when the shortcode sets a `record` course id.
   ============================================================ */
.dsq-summary__outcome {
	display: inline-block;
	margin: 0 auto 0.75rem auto;
	padding: 0.35rem 1rem;
	border-radius: 999px;
	font-size: 1rem;
	font-weight: 700;
}

.dsq-summary__outcome--pass {
	background: #f0fdf4;
	color: #14532d;
	border: 2px solid var( --dsq-correct );
}

.dsq-summary__outcome--fail {
	background: #fef2f2;
	color: #7f1d1d;
	border: 2px solid var( --dsq-wrong );
}

/* ============================================================
   Select-words mode (tap the stressed words / the main verbs / …)
   ============================================================ */
.dsq-select-words {
	margin-top: 0.5rem;
}

.dsq-words {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem 0.5rem;
	line-height: 1.9;
	margin-bottom: 1rem;
}

.dsq-word {
	display: inline-block;
	padding: 0.25rem 0.55rem;
	border: 2px solid var( --dsq-accent );
	border-radius: 8px;
	background: #fff;
	color: var( --dsq-accent );
	font: inherit;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	box-shadow: none;
	text-shadow: none;
	transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.dsq-word:hover:not( :disabled ),
.dsq-word:focus:not( :disabled ),
.dsq-word:active:not( :disabled ) {
	background: rgba( 0, 0, 0, 0.04 );
	color: var( --dsq-accent );
}

.dsq-word--selected {
	background: var( --dsq-accent );
	border-color: var( --dsq-accent );
	color: var( --dsq-accent-contrast );
}

.dsq-word--target {
	background: var( --dsq-correct );
	border-color: var( --dsq-correct );
	color: #fff;
}

.dsq-word--missed {
	border-color: var( --dsq-correct );
	border-style: dashed;
	color: var( --dsq-correct );
	background: #fff;
}

.dsq-word--wrong {
	background: var( --dsq-wrong );
	border-color: var( --dsq-wrong );
	color: #fff;
	text-decoration: line-through;
}

.dsq-word:disabled {
	cursor: default;
}

/* ============================================================
   Order modes (order-sentence + order-paragraph)
   ============================================================ */
.dsq-order { margin-top: 0.5rem; }

.dsq-order-line {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem 0.5rem;
	min-height: 3rem;
	padding: 0.6rem;
	margin-bottom: 0.9rem;
	border: 2px dashed var( --dsq-accent );
	border-radius: 10px;
	background: #fff;
}
.dsq-order-line--correct { border-style: solid; border-color: var( --dsq-correct ); }
.dsq-order-line--wrong { border-style: solid; border-color: var( --dsq-wrong ); }

.dsq-order-bank {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem 0.5rem;
	margin-bottom: 1rem;
}
.dsq-order-word { line-height: 1.4; }
.dsq-order-placeholder { color: var( --dsq-muted ); font-style: italic; }
.dsq-order-tail { align-self: center; padding: 0.25rem 0.15rem; font: inherit; color: var( --dsq-accent ); font-weight: 600; }

.dsq-short-input { display: block; width: 100%; max-width: 460px; margin: 0 auto; text-align: center; }

/* paragraph cards */
.dsq-order-cards { display: flex; flex-direction: column; gap: 0.5rem; }
.dsq-order-cards--line {
	min-height: 3rem;
	padding: 0.6rem;
	margin-bottom: 0.9rem;
	border: 2px dashed var( --dsq-accent );
	border-radius: 10px;
	background: #fff;
}
.dsq-order-cards--bank { margin-bottom: 1rem; }
.dsq-order-card {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	padding: 0.6rem 0.7rem;
	border: 2px solid var( --dsq-accent );
	border-radius: 10px;
	background: #fff;
	cursor: pointer;
}
.dsq-order-card:hover { background: rgba( 0, 0, 0, 0.04 ); }
.dsq-order-card--chosen { border-color: var( --dsq-accent ); background: #f7fbfa; }
.dsq-order-card--right { border-color: var( --dsq-correct ); background: #ecfdf5; cursor: default; }
.dsq-order-card--wrong { border-color: var( --dsq-wrong ); background: #fef2f2; cursor: default; }
.dsq-order-card-text { flex: 1; }
.dsq-order-badge {
	flex: 0 0 auto;
	width: 26px; height: 26px;
	display: inline-flex; align-items: center; justify-content: center;
	border-radius: 50%;
	background: var( --dsq-accent );
	color: var( --dsq-accent-contrast );
	font-weight: 700; font-size: 0.85rem;
}
.dsq-order-card .dsq-prompt-audio { margin: 0; }
.dsq-order-card .dsq-audio-btn { width: 36px; height: 36px; }
.dsq-order-card .dsq-audio-btn svg { width: 22px; height: 22px; }

/* ============================================================
   Intonation-match mode  (v1.16.0)
   ============================================================ */

.dsq-into-phrase {
	font-size: 1.25rem;
	font-weight: 600;
	text-align: center;
	margin: 0 0 1rem;
}

.dsq-into-options {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.dsq-into-option {
	display: flex;
	align-items: stretch;
	gap: 0.6rem;
}

.dsq-into-play {
	flex: 0 0 auto;
	width: 52px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 2px solid var( --dsq-audio );
	border-radius: 8px;
	background: var( --dsq-audio );
	color: #1a1a1a;
	cursor: pointer;
}

.dsq-into-play:hover {
	filter: brightness( 0.96 );
}

.dsq-into-play svg {
	display: block;
}

.dsq-into-choose {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.35rem;
	min-height: 64px;
	padding: 0.6rem 0.75rem;
	border: 2px solid var( --dsq-accent );
	border-radius: 8px;
	background: #ffffff;
	color: var( --dsq-accent );
	font-family: inherit;
	font-size: 1rem;
	font-weight: 500;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.dsq-into-choose:hover:not(:disabled) {
	background: var( --dsq-accent );
	color: var( --dsq-accent-contrast );
	transform: translateY( -1px );
}

.dsq-into-choose:disabled {
	cursor: not-allowed;
}

.dsq-into-contour {
	width: 100%;
	max-width: 220px;
	height: 48px;
	display: block;
}

.dsq-into-guide {
	stroke: currentColor;
	stroke-width: 0.4;
	opacity: 0.25;
}

.dsq-into-line {
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
	vector-effect: non-scaling-stroke;
}

.dsq-into-end {
	fill: currentColor;
}

.dsq-into-label {
	font-size: 0.95rem;
	text-align: center;
}

.dsq-into-choose--correct {
	background: var( --dsq-correct );
	border-color: var( --dsq-correct );
	color: #ffffff;
}

.dsq-into-choose--wrong {
	background: var( --dsq-wrong );
	border-color: var( --dsq-wrong );
	color: #ffffff;
	animation: dsq-shake 0.4s ease;
}

.dsq-into-choose--reveal {
	background: var( --dsq-correct );
	border-color: var( --dsq-correct );
	color: #ffffff;
	opacity: 0.85;
}

@media ( prefers-reduced-motion: reduce ) {
	.dsq-into-choose--wrong {
		animation: none;
	}
}
