/**!
 * @file ViewLesson.css
 * @desc Modern reading shell for the public-facing lesson view page
 *       (esl_viewLesson.php).
 *
 *       Layout: 2-column at desktop (article + right sidebar with sibling
 *       lessons + teacher card). Article is a single white "page" with
 *       hero header → optional hero image → passage prose → optional
 *       audio / translation / map / vocabulary / quizzes / comments.
 *
 *       All rules scoped under body.view-lesson so nothing leaks. Plays
 *       cooperatively with the legacy `highlightword`, `figure` and
 *       Bootstrap `card`/`form-control` styles still loaded for the
 *       embedded passage images and the comments form.
 */
/************************************************************************************************************************************/

body.view-lesson {
	--vl-brand:      var(--sw-brand-color, var(--brand-dark));
	--vl-brand-dark: var(--brand-darker);
	--vl-brand-soft: #e8f3ec;
	--vl-brand-tint: #f4f9f5;
	--vl-ink:        #14211a;
	--vl-ink-soft:   #4a5b51;
	--vl-card:       #ffffff;
	--vl-border:     #e0e8e3;
	--vl-radius:     14px;
	--vl-radius-sm:  10px;
	--vl-max-width:  1280px;
	--vl-shadow:     0 1px 2px rgba(20, 50, 30, 0.04),
	                 0 8px 28px rgba(20, 50, 30, 0.08);
	--vl-shadow-sm:  0 1px 2px rgba(20, 50, 30, 0.04),
	                 0 4px 14px rgba(20, 50, 30, 0.06);

	/* Override sw_common.css body green so the page sits on a neutral
	   surface instead of being framed in harsh brand color. */
	background-color: var(--vl-brand-tint) !important;
}

/* ------------------------------------------------------------------ */
/* PAGE + GRID                                                         */
/* ------------------------------------------------------------------ */

body.view-lesson .lesson-page {
	max-width: var(--vl-max-width);
	margin: 0 auto;
	padding: 18px 16px 32px 16px;
}

body.view-lesson .lesson-content {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 320px;
	gap: 24px;
	align-items: start;
}

/* ------------------------------------------------------------------ */
/* ARTICLE CARD                                                        */
/* ------------------------------------------------------------------ */

body.view-lesson .lesson-article {
	background: var(--vl-card);
	border-radius: var(--vl-radius);
	box-shadow: var(--vl-shadow);
	overflow: hidden;
	min-width: 0;
}

/* --- Hero header inside the article card --- */

body.view-lesson .lesson-hero {
	padding: 32px 40px 20px 40px;
	border-bottom: 1px solid var(--vl-border);
}

body.view-lesson .lesson-hero__breadcrumb {
	margin-bottom: 8px;
}

body.view-lesson .lesson-hero__breadcrumb a {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--vl-brand-dark);
	font-size: 0.85rem;
	font-weight: 600;
	text-decoration: none;
	padding: 4px 10px;
	border-radius: 999px;
	background: var(--vl-brand-soft);
	transition: background 0.15s ease;
}

body.view-lesson .lesson-hero__breadcrumb a:hover {
	background: var(--vl-brand);
	color: #fff;
}

body.view-lesson .lesson-hero__title {
	font-size: clamp(1.7rem, 3vw, 2.4rem);
	font-weight: 800;
	margin: 12px 0 10px 0;
	color: var(--vl-ink);
	line-height: 1.2;
	letter-spacing: -0.01em;
}

/* Standfirst / "dek" — the lesson intro shown under the title, NYT-style. */
body.view-lesson .lesson-hero__dek {
	margin: 0 0 14px 0;
	max-width: 72ch;
	font-size: clamp(0.95rem, 1.4vw, 1.05rem);
	font-style: italic;
	font-weight: 400;
	line-height: 1.55;
	color: var(--vl-ink-soft);
}

/* Japanese has no true italics — keep the JP dek upright. */
body.view-lesson .lesson-hero__dek--jp {
	font-style: normal;
}

/* Date/author on the left, Listen/Translation buttons pushed to the right. */
body.view-lesson .lesson-hero__metabar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
	margin: 0;
}

body.view-lesson .lesson-hero__meta {
	margin: 0;
	font-size: 0.9rem;
	color: var(--vl-ink-soft);
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

body.view-lesson .lesson-hero__meta span {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

body.view-lesson .lesson-hero__divider {
	color: var(--vl-border);
}

body.view-lesson .lesson-hero__actions {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

/* --- Buttons --- */

body.view-lesson .lesson-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 9px 18px;
	border-radius: 999px;
	font-weight: 600;
	font-size: 0.9rem;
	text-decoration: none;
	border: 1.5px solid transparent;
	transition: transform 0.1s ease, background 0.15s ease,
	            border-color 0.15s ease, box-shadow 0.15s ease;
	cursor: pointer;
	font-family: inherit;
}

body.view-lesson .lesson-btn--primary {
	background: var(--vl-brand);
	color: #fff;
	box-shadow: 0 3px 8px rgba(17, 184, 181, 0.22);
}

body.view-lesson .lesson-btn--primary:hover {
	background: var(--vl-brand-dark);
	color: #fff;
	transform: translateY(-1px);
}

body.view-lesson .lesson-btn--ghost {
	background: transparent;
	color: var(--vl-brand-dark);
	border-color: #c8d5cd;
}

body.view-lesson .lesson-btn--ghost:hover {
	background: var(--vl-brand-soft);
	border-color: var(--vl-brand);
	color: var(--vl-brand-dark);
}

/* --- Hero image (full width, capped height) --- */

body.view-lesson .lesson-article__image {
	width: 100%;
	max-height: 420px;
	overflow: hidden;
	background: var(--vl-brand-soft);
}

body.view-lesson .lesson-article__image img {
	width: 100%;
	height: auto;
	display: block;
}

/* Modifier when the hero image fails to load and we swap in the SW logo
   (or any other square brand fallback). Centers it in a brand-tinted area
   and caps the rendered size so it doesn't dominate the page. */
body.view-lesson .lesson-article__image--logo {
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--vl-brand-soft);
	padding: 24px;
	max-height: 240px;
}

body.view-lesson .lesson-article__image--logo img {
	width: auto;
	max-width: 200px;
	max-height: 192px;
	object-fit: contain;
}

/* --- Article body --- */

body.view-lesson .lesson-article__body {
	padding: 32px 40px 40px 40px;
}

/* Catalog browse pages (grammar / idiom lists) reuse this article shell but are
   NOT an article — tighten the big hero→content gap and drop the leading rule/
   padding on the first category. Plus the instant client-side search box. */
body.view-lesson.catalog-list .lesson-article__body { padding-top: 12px; }
body.view-lesson.catalog-list .lesson-section:first-of-type {
	margin-top: 0; padding-top: 0; border-top: none;
}
/* Anchor-jump targets shouldn't hide under a fixed site header. */
body.view-lesson.catalog-list .lesson-section { scroll-margin-top: 90px; }

/* Search + Level filter sit on one row. */
body.view-lesson .cat-controls {
	display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 6px 0 4px;
}
body.view-lesson .cat-search {
	display: flex; align-items: center; gap: 8px;
	flex: 1 1 260px; max-width: 420px; margin: 0;
	padding: 9px 14px;
	border: 1px solid var(--vl-border); border-radius: 999px; background: #fff;
}
body.view-lesson .cat-search i { color: var(--vl-ink-soft); }
body.view-lesson .cat-search input {
	flex: 1; border: 0; outline: 0; background: transparent;
	font-size: 1rem; color: var(--vl-ink);
}
body.view-lesson .cat-level {
	flex: 0 0 auto; padding: 9px 14px;
	border: 1px solid var(--vl-border); border-radius: 999px; background: #fff;
	font-size: 0.95rem; color: var(--vl-ink);
}
body.view-lesson .cat-search__empty {
	max-width: 720px; margin: 24px auto 0; color: var(--vl-ink-soft);
}

/* Category jump bar — static wrapping chips that scroll to each section. */
body.view-lesson .cat-jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
body.view-lesson .cat-jump__chip {
	display: inline-block; padding: 5px 13px; border-radius: 999px;
	border: 1px solid var(--vl-border); background: #fff; color: var(--vl-ink);
	text-decoration: none; font-size: 0.88rem; font-weight: 600; cursor: pointer;
}
body.view-lesson .cat-jump__chip:hover { background: var(--brand); color: #fff; border-color: var(--brand); }

/* Eiken (英検) equivalent shown alongside the CEFR level on cards. */
body.view-lesson .cat-eiken { opacity: 0.85; font-weight: 600; }

/* --- Passage prose --- */

body.view-lesson .lesson-passage {
	max-width: 720px;
	margin: 0 auto;
	font-size: 1.05rem;
	line-height: 1.75;
	color: var(--vl-ink);
}

body.view-lesson .lesson-passage p {
	margin: 0 0 1.1em 0;
}

/* Override legacy viewObject.css rules which force figure.image to
   display:inline-block + float:left + width-from-image, causing long
   captions to wrap awkwardly to the image's narrow width. We want
   figures to be block-level and span the reading column so captions
   can wrap freely across the full ~720px width. */
body.view-lesson .lesson-passage figure,
body.view-lesson .lesson-passage figure.image,
body.view-lesson .lesson-passage figure.imagelarge,
body.view-lesson .lesson-passage figure.align-left,
body.view-lesson .lesson-passage figure.align-right {
	display: block !important;
	float: none !important;
	width: auto !important;
	max-width: 100%;
	margin: 2em auto !important;
	padding: 0;
	border: none;
	background: transparent;
	text-align: center;
	clear: both;
}

body.view-lesson .lesson-passage figure img,
body.view-lesson .lesson-passage figure.image img,
body.view-lesson .lesson-passage figure.imagelarge img {
	max-width: 100%;
	height: auto;
	width: auto;
	border-radius: 8px;
	display: block;
	margin: 0 auto;
}

body.view-lesson .lesson-passage figcaption,
body.view-lesson .lesson-passage figure.image figcaption,
body.view-lesson .lesson-passage figure.imagelarge figcaption {
	font-size: 0.88rem;
	color: var(--vl-ink-soft);
	margin-top: 10px;
	font-style: italic;
	background: transparent;
	border: none;
	text-align: center;
	width: auto;
	max-width: 100%;
	line-height: 1.5;
}

body.view-lesson .lesson-passage img:not(figure img) {
	max-width: 100%;
	height: auto;
	border-radius: 8px;
}

/* Neutralize legacy float/align baked into passage markup by TinyMCE.
   All images and figures in the passage render as centered blocks with
   generous breathing room — uniform, no caption-floating-into-text issues. */
body.view-lesson .lesson-passage img,
body.view-lesson .lesson-passage figure,
body.view-lesson .lesson-passage figure.image,
body.view-lesson .lesson-passage figure.imagelarge {
	float: none !important;
	clear: both;
}

body.view-lesson .lesson-passage img {
	display: block !important;
	margin: 2em auto !important;
	max-width: 100% !important;
	width: auto !important;
	height: auto !important;
	border-radius: 8px;
}

/* When an img sits inside a figure, the figure owns the spacing — kill the
   double margin on the inner img. */
body.view-lesson .lesson-passage figure img {
	margin: 0 auto !important;
}

/* Clearfix at the end of the passage so a trailing floated image doesn't
   cause the next section (translation / vocab / quiz) to slide alongside it. */
body.view-lesson .lesson-passage::after {
	content: "";
	display: block;
	clear: both;
}

/* --- Audio player container --- */

body.view-lesson .lesson-audio-player {
	max-width: 720px;
	margin: 0 auto 24px auto;
	padding: 16px 18px;
	background: var(--vl-brand-soft);
	border-radius: var(--vl-radius-sm);
	display: flex;
	flex-direction: column;
	gap: 8px;
}

body.view-lesson .lesson-audio-player__hint {
	margin: 0;
	font-size: 0.85rem;
	color: var(--vl-ink-soft);
}

body.view-lesson .lesson-audio-player audio {
	width: 100%;
}

/* --- Translation block --- */

body.view-lesson .lesson-translation {
	max-width: 720px;
	margin: 28px auto 0 auto;
	padding: 24px;
	background: var(--vl-brand-soft);
	border-radius: var(--vl-radius-sm);
	border-left: 4px solid var(--vl-brand);
}

body.view-lesson .lesson-translation__title {
	font-size: 1.25rem;
	font-weight: 700;
	color: var(--vl-ink);
	margin: 0 0 12px 0;
}

body.view-lesson .lesson-translation__passage {
	font-size: 1rem;
	line-height: 1.7;
	color: var(--vl-ink);
}

/* --- Section wrapper (vocab / quizzes / map / comments) --- */

body.view-lesson .lesson-section {
	max-width: 720px;
	margin: 20px auto 0 auto;
	padding-top: 28px;
	border-top: 1px solid var(--vl-border);
}

body.view-lesson .lesson-section__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 18px;
	flex-wrap: wrap;
}

body.view-lesson .lesson-section__title {
	font-size: 1.3rem;
	font-weight: 700;
	color: var(--vl-ink);
	margin: 0 0 18px 0;
	display: inline-flex;
	align-items: center;
	gap: 10px;
}

body.view-lesson .lesson-section__header .lesson-section__title {
	margin: 0;
}

body.view-lesson .lesson-section__title i {
	color: var(--vl-brand);
}

/* Optional teacher-authored category intro, shown under the category heading. */
body.view-lesson .cat-intro {
	margin: -6px 0 16px 0;
	color: var(--vl-ink-soft, #4a5b51);
	font-size: 0.95rem;
	line-height: 1.6;
}
body.view-lesson .cat-intro p { margin: 0 0 8px 0; }
body.view-lesson .cat-intro p:last-child { margin-bottom: 0; }

body.view-lesson .lesson-section__cta {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 0.88rem;
	font-weight: 600;
	color: var(--vl-brand-dark);
	text-decoration: none;
	padding: 6px 14px;
	border-radius: 999px;
	border: 1.5px solid #c8d5cd;
	transition: background 0.15s ease, border-color 0.15s ease;
}

body.view-lesson .lesson-section__cta:hover {
	background: var(--vl-brand-soft);
	border-color: var(--vl-brand);
	color: var(--vl-brand-dark);
}

/* --- Map --- */

body.view-lesson .map-container {
	position: relative;
	width: 100%;
	padding-bottom: 56.25%;
	border-radius: var(--vl-radius-sm);
	overflow: hidden;
	box-shadow: var(--vl-shadow-sm);
}

body.view-lesson .map-container iframe {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* --- Vocabulary --- */

body.view-lesson .lesson-vocab-list {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

body.view-lesson .lesson-vocab-list__footer {
	display: flex;
	justify-content: center;
	margin-top: 22px;
}

body.view-lesson .lesson-vocab-card {
	background: var(--vl-brand-tint);
	border: 1px solid var(--vl-border);
	border-radius: var(--vl-radius-sm);
	padding: 16px 18px;
}

body.view-lesson .lesson-vocab-card__header {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

body.view-lesson .lesson-vocab-card__word {
	font-size: 1.1rem;
	font-weight: 700;
	color: var(--vl-ink);
	text-decoration: none;
}

body.view-lesson .lesson-vocab-card__word:hover {
	color: var(--vl-brand-dark);
	text-decoration: underline;
}

/* Word-level CEFR + frequency-band chips on each vocab card. */
body.view-lesson .lesson-vocab-card__levels {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-left: auto;
}
body.view-lesson .vocab-level {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 0.68rem;
	font-weight: 800;
	padding: 3px 9px;
	border-radius: 999px;
	line-height: 1;
}
body.view-lesson .vocab-level--cefr {
	background: #eef2f0;
	color: var(--brand-dark);
	border: 1px solid #d5ddd8;
	letter-spacing: 0.03em;
}
body.view-lesson .vocab-level--band {
	color: #fff;
	background: var(--vb, #64748b);
}
body.view-lesson .vocab-level--band i { font-size: 0.82em; }
body.view-lesson .vocab-level--cefr .vocab-level__meaning { font-weight: 600; opacity: 0.8; }

body.view-lesson .lesson-vocab-card__speak {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: var(--vl-brand);
	color: #fff;
	border: none;
	cursor: pointer;
	font-size: 0.85rem;
	transition: background 0.15s ease, transform 0.1s ease;
	padding: 0;
}

body.view-lesson .lesson-vocab-card__speak:hover {
	background: var(--vl-brand-dark);
	transform: scale(1.05);
}

body.view-lesson .lesson-vocab-card__phonetics {
	color: var(--vl-ink-soft);
	font-size: 0.95rem;
}

body.view-lesson .lesson-vocab-card__examples {
	margin: 12px 0 0 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

body.view-lesson .lesson-vocab-card__example {
	padding: 10px 12px;
	background: #fff;
	border-radius: 6px;
	border-left: 3px solid var(--vl-brand);
}

body.view-lesson .lesson-vocab-card__example-en {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	color: var(--vl-ink);
	line-height: 1.55;
}

body.view-lesson .lesson-vocab-card__example-en > span {
	flex: 1;
}

body.view-lesson .lesson-vocab-card__example-en .lesson-vocab-card__speak {
	width: 24px;
	height: 24px;
	font-size: 0.7rem;
	flex-shrink: 0;
	margin-top: 2px;
}

body.view-lesson .lesson-vocab-card__example-jp {
	font-size: 0.9rem;
	color: var(--vl-ink-soft);
	margin-top: 4px;
}

/* --- Quizzes --- */

body.view-lesson .lesson-quizzes {
	display: grid;
	grid-template-columns: 1fr;
	gap: 10px;
}

body.view-lesson .lesson-quiz-btn {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 18px;
	background: var(--vl-brand-soft);
	border: 1.5px solid var(--vl-brand);
	border-radius: var(--vl-radius-sm);
	color: var(--vl-ink);
	font-weight: 600;
	font-size: 1rem;
	text-decoration: none;
	transition: background 0.15s ease, transform 0.1s ease;
}

body.view-lesson .lesson-quiz-btn:hover {
	background: var(--vl-brand);
	color: #fff;
	transform: translateY(-1px);
}

body.view-lesson .lesson-quiz-btn i {
	color: var(--vl-brand);
	font-size: 1.1rem;
}

body.view-lesson .lesson-quiz-btn:hover i {
	color: #fff;
}

/* --- Comments: inviting heading, count badge, prompt --- */

/* "(3)" count that follows the section prompt in the heading */
body.view-lesson .lesson-section__title .comment-count {
	font-size: 0.95rem;
	font-weight: 600;
	color: var(--vl-brand);
	margin-left: 2px;
}

/* One-line invitation under the "What did you think?" heading */
body.view-lesson .lesson-comment-invite {
	margin: -8px 0 16px 0;
	color: var(--vl-ink-soft, #4a5b51);
	font-size: 0.95rem;
	line-height: 1.5;
}

/* Leave room under the sticky header when the hero chip jumps here */
body.view-lesson #lesson-comments { scroll-margin-top: 90px; }

/* --- Comments form polish (keep Bootstrap classes for Comments.js) --- */

body.view-lesson .lesson-comment-form {
	background: var(--vl-brand-tint);
	border: 1px solid var(--vl-border);
	border-radius: var(--vl-radius-sm);
	padding: 16px;
}

body.view-lesson .lesson-comment-form .form-control {
	border-radius: 6px;
	border: 1px solid var(--vl-border);
	font-size: 0.95rem;
}

body.view-lesson .lesson-comment-form .form-control:focus {
	border-color: var(--vl-brand);
	box-shadow: 0 0 0 3px var(--vl-brand-soft);
	outline: none;
}

body.view-lesson .lesson-comment-form .btn-primary {
	background: var(--vl-brand);
	border-color: var(--vl-brand);
	font-weight: 600;
	padding: 8px 20px;
	border-radius: 999px;
}

body.view-lesson .lesson-comment-form .btn-primary:hover {
	background: var(--vl-brand-dark);
	border-color: var(--vl-brand-dark);
}

/* ------------------------------------------------------------------ */
/* SIDEBAR — sibling lessons + teacher card                            */
/* ------------------------------------------------------------------ */

body.view-lesson .lesson-sidebar {
	position: sticky;
	top: 16px;
	display: flex;
	flex-direction: column;
	gap: 18px;
}

/* Series Lessons panel header — emulate the home page "Browse Themes" rail banner:
   the navbar-style layered green gradient with a white title (was a flat light-
   green bar). Scoped to the lesson sidebar so other .ll-panel uses are untouched. */
body.view-lesson .lesson-sidebar .ll-panel__title {
	color: #fff;
	background:
		radial-gradient(ellipse 60% 180% at 85% -30%, rgba(17, 184, 181, 0.28) 0%, rgba(17, 184, 181, 0.10) 45%, transparent 75%),
		linear-gradient(135deg, var(--ll-brand, var(--brand-dark)) 0%, var(--ll-brand-dark, var(--brand-darker)) 100%);
	border-bottom-color: var(--ll-brand-dark, var(--brand-darker));
}

/* Panel sections (.ll-panel*) + hovercard tooltip are now in the shared
   LessonListPanel.css. Page only owns the outer sticky aside + teacher card. */

/* --- Teacher card --- */

body.view-lesson .lesson-sidebar__teacher {
	background: var(--vl-card);
	border-radius: var(--vl-radius);
	box-shadow: var(--vl-shadow-sm);
	padding: 18px 18px;
	display: flex;
	align-items: center;
	gap: 12px;
}

body.view-lesson .lesson-sidebar__teacher-avatar {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: var(--vl-brand-soft);
	color: var(--vl-brand-dark);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 22px;
	flex-shrink: 0;
}

body.view-lesson .lesson-sidebar__teacher-text {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

body.view-lesson .lesson-sidebar__teacher-label {
	font-size: 0.75rem;
	color: var(--vl-ink-soft);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	font-weight: 600;
}

body.view-lesson .lesson-sidebar__teacher-name {
	font-size: 0.95rem;
	font-weight: 700;
	color: var(--vl-ink);
}

/* ------------------------------------------------------------------ */
/* RESPONSIVE                                                          */
/* ------------------------------------------------------------------ */

@media (max-width: 1024px) {
	body.view-lesson .lesson-content {
		grid-template-columns: 1fr;
	}
	body.view-lesson .lesson-sidebar {
		position: static;
	}
}

@media (max-width: 720px) {
	body.view-lesson .lesson-hero {
		padding: 24px 22px 20px 22px;
	}
	body.view-lesson .lesson-article__body {
		padding: 22px 22px 30px 22px;
	}
	body.view-lesson .lesson-passage {
		font-size: 1rem;
		line-height: 1.7;
	}
	body.view-lesson .lesson-hero__title {
		font-size: 1.55rem;
	}
	/* On phones, drop the buttons onto their own centered row and shrink them. */
	body.view-lesson .lesson-hero__actions {
		flex-basis: 100%;
		justify-content: center;
		margin-top: 4px;
	}
	body.view-lesson .lesson-hero .lesson-btn {
		padding: 7px 14px;
		font-size: 0.82rem;
	}
}

/* ── CEFR reading-level badge (lesson hero) ──────────────────────────────────
   Green band pill + info icon with a hover/tap tooltip. Added 2026-07-02. */
body.view-lesson .lesson-level {
	position: relative;
	gap: 5px !important;
	cursor: pointer;
	outline: none;
}
body.view-lesson .lesson-level:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
body.view-lesson .lesson-level > i.fa-signal { color: var(--brand); }
body.view-lesson .lesson-level__band {
	display: inline-block !important;
	padding: 1px 8px;
	border-radius: 999px;
	background: var(--brand);
	color: #fff;
	font-weight: 700;
	font-size: 0.8rem;
	line-height: 1.5;
}
body.view-lesson .lesson-level__info { color: #9aa89e; font-size: 0.8rem; transition: color 0.15s ease; }
body.view-lesson .lesson-level:hover .lesson-level__info,
body.view-lesson .lesson-level:focus-within .lesson-level__info { color: var(--brand); }

/* Polished light-card tooltip — mirrors the right-panel lessons-list hover
   (white card, soft green-tinted border + shadow, upward arrow). */
body.view-lesson .lesson-level__tip {
	/* !important beats `.lesson-hero__meta span { display: inline-flex }`
	   (specificity 0,2,2) which would otherwise force this span visible. */
	display: none !important;
	flex-direction: column;
	gap: 9px;
	position: absolute;
	top: calc(100% + 11px);
	left: 0;
	z-index: 100;
	width: max-content;
	max-width: 320px;
	padding: 14px 16px;
	background: #ffffff;
	color: #14211a;
	font-size: 0.84rem;
	font-weight: 400;
	line-height: 1.5;
	text-align: left;
	border: 1px solid #e0e8e3;
	border-radius: 10px;
	box-shadow: 0 14px 36px rgba(20,50,30,0.18), 0 2px 6px rgba(20,50,30,0.08);
	white-space: normal;
}
/* Two-layer upward arrow (border triangle under the white one). */
body.view-lesson .lesson-level__tip::before,
body.view-lesson .lesson-level__tip::after {
	content: "";
	position: absolute;
	bottom: 100%;
	left: 22px;
	border-left: 8px solid transparent;
	border-right: 8px solid transparent;
}
body.view-lesson .lesson-level__tip::before { border-bottom: 8px solid #e0e8e3; }
body.view-lesson .lesson-level__tip::after  { border-bottom: 8px solid #ffffff; margin-bottom: -1px; }

/* Click-to-open popover — visibility is driven SOLELY by the JS .is-open class
   so it toggles deterministically. Not hover (a 320px card overlapping the
   article would stay up under the pointer), and NOT :focus-visible for showing
   (post-click focus would keep it pinned open — the real "stuck open" cause).
   Keyboard open/close is handled by the toggle script; :focus-visible is used
   only for the focus outline above. */
body.view-lesson .lesson-level.is-open .lesson-level__tip { display: flex !important; }

body.view-lesson .lesson-level__tip .llt-meaning {
	display: block;
	font-weight: 700;
	color: #14211a;
	line-height: 1.4;
}
body.view-lesson .lesson-level__tip .llt-why {
	display: block;
	font-style: italic;
	color: #4a5b51;
	padding-left: 9px;
	border-left: 3px solid var(--brand);
}
/* Force every descendant left-aligned + normal weight so nothing inherited from
   the hero/meta can center or embolden a row (defensive against cascade). */
body.view-lesson .lesson-level__tip,
body.view-lesson .lesson-level__tip * { text-align: left !important; font-weight: 400; }

body.view-lesson .lesson-level__tip .llt-dims {
	display: flex !important;
	flex-direction: column;
	align-items: flex-start;
	gap: 4px;
	padding-top: 9px;
	border-top: 1px solid #e0e8e3;
}
/* Natural left-aligned "Label: value" rows (no spread-apart columns). */
body.view-lesson .lesson-level__tip .llt-row { display: block !important; }
body.view-lesson .lesson-level__tip .llt-meaning { font-weight: 700; }
body.view-lesson .lesson-level__tip .llt-k { display: inline; color: #4a5b51; font-weight: 700; }
body.view-lesson .lesson-level__tip .llt-k::after { content: ": "; }
body.view-lesson .lesson-level__tip .llt-v { display: inline; color: #14211a; }
body.view-lesson .lesson-level__tip .llt-note { display: inline; color: #8a978d; font-size: 0.74rem; }

/* Eiken (英検) equivalent — small green pill next to the CEFR band + tooltip line. 2026-07-03 */
body.view-lesson .lesson-level__eiken {
	display: inline-block !important;
	font-size: 0.72rem;
	font-weight: 600;
	color: var(--brand);
	background: #e8f3ec;
	padding: 1px 7px;
	border-radius: 999px;
	line-height: 1.5;
}
body.view-lesson .lesson-level__tip .llt-eiken {
	display: inline-block;
	align-self: flex-start;
	font-weight: 700;
	color: var(--brand);
	background: #e8f3ec;
	padding: 1px 9px;
	border-radius: 999px;
}

/* Grammar catalog cards + grammar point view (students). 2026-07-03 */
body.view-lesson .lesson-grammar-list { display: flex; flex-wrap: wrap; gap: 12px; }
body.view-lesson .lesson-grammar-card {
	display: flex; flex-direction: column; gap: 4px;
	flex: 1 1 240px; max-width: 340px;
	padding: 14px 16px; background: #fff; border: 1px solid #e0e8e3; border-radius: 10px;
	text-decoration: none; color: #14211a; box-shadow: 0 1px 2px rgba(20,50,30,0.04);
	transition: box-shadow .15s ease, border-color .15s ease;
}
body.view-lesson .lesson-grammar-card:hover { border-color: var(--brand); box-shadow: 0 6px 18px rgba(20,50,30,0.1); }
body.view-lesson .lesson-grammar-card__cat { font-size: .72rem; font-weight: 700; color: var(--brand); text-transform: uppercase; letter-spacing: .03em; }
body.view-lesson .lesson-grammar-card__title { font-size: 1rem; font-weight: 700; }
body.view-lesson .lesson-grammar-card__level { align-self: flex-start; font-size: .72rem; font-weight: 700; color: var(--brand); background: #e8f3ec; padding: 1px 8px; border-radius: 999px; }
body.view-lesson .gr-view__pattern { display: inline-block; font-family: monospace; background: #f0faf4; border: 1px solid #cdeeda; color: #14532d; padding: 6px 12px; border-radius: 8px; margin-bottom: 8px; }
body.view-lesson .gr-view__h { font-size: 1.15rem; font-weight: 800; margin: 24px 0 8px; color: #14211a; }
body.view-lesson .gr-view__en { margin: 0 0 6px; }
body.view-lesson .gr-view__jp { margin: 0 0 6px; color: #4a5b51; }
body.view-lesson .gr-view__examples { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
body.view-lesson .gr-view__examples li { padding: 10px 14px; background: #f4f9f5; border-left: 3px solid var(--brand); border-radius: 6px; }
body.view-lesson .gr-view__ex-en { display: block; font-weight: 600; }
body.view-lesson .gr-view__ex-jp { display: block; color: #4a5b51; margin-top: 2px; }
body.view-lesson .gr-view__mistakes { background: #fef6f0; border-left: 3px solid #b45309; border-radius: 6px; padding: 10px 14px; }
/* Light rich-text (grammar explanation/mistakes, idiom meaning): keep the teacher's
   bold/italic/underline + lists, with tidy paragraph/list spacing. */
body.view-lesson .gr-view__rich p { margin: 0 0 8px; }
body.view-lesson .gr-view__rich p:last-child { margin-bottom: 0; }
body.view-lesson .gr-view__rich ul, body.view-lesson .gr-view__rich ol { margin: 6px 0 8px; padding-left: 22px; }
body.view-lesson .gr-view__rich li { margin: 2px 0; }
/* Simple tables (conjugation/pronoun/comparison grids). */
body.view-lesson .gr-view__rich table { border-collapse: collapse; margin: 8px 0 12px; width: 100%; max-width: 100%; }
body.view-lesson .gr-view__rich th, body.view-lesson .gr-view__rich td { border: 1px solid #cdd6d0; padding: 6px 10px; text-align: left; vertical-align: top; }
body.view-lesson .gr-view__rich th { background: #eef4f0; font-weight: 700; }
body.view-lesson .gr-view__rich caption { caption-side: top; text-align: left; font-weight: 700; color: #4a5b51; margin-bottom: 4px; }
/* Teacher-applied text colors in grammar/idiom prose (rt-red/green/blue).
   Readable (WCAG-AA on white); the only classes the sanitizer lets through. */
.gr-view__rich .rt-red   { color: #c0392b; }
.gr-view__rich .rt-green { color: #1e7e34; }
.gr-view__rich .rt-blue  { color: #1565c0; }
body.view-lesson .gr-view-level { font-size: .8rem; font-weight: 700; color: var(--brand); background: #e8f3ec; padding: 2px 10px; border-radius: 999px; }
/* Eiken (英検) equivalent shown next to the CEFR band — the standard JP learners know. */
body.view-lesson .gr-view-eiken { font-size: .8rem; font-weight: 700; color: #4a5b51; background: #eef2ef; padding: 2px 10px; border-radius: 999px; margin-left: 6px; }

/* Idioms — reuse the grammar card/view classes; these add the idiom-only bits. */
body.view-lesson .lesson-idiom-card__meaning { font-size: .82rem; color: #4a5b51; line-height: 1.35; }

/* "Listen" buttons (browser speech / stored MP3) on points/idioms + examples. */
body.view-lesson .cat-audio-btn { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; padding: 0; border: 1px solid #cde0d4; background: #f0faf4; color: var(--brand); border-radius: 50%; cursor: pointer; vertical-align: middle; font-size: .8rem; line-height: 1; transition: background .12s; }
body.view-lesson .cat-audio-btn:hover { background: #dff1e6; }
body.view-lesson .cat-audio-btn--lg { width: 34px; height: 34px; font-size: 1rem; margin-left: 8px; }

/* Catalog view sidebar cards (grammar/idiom right column): "More in this
   category", the Formality & Level legend, and "Appears in lessons". */
body.view-lesson .catalog-side .side-card {
	background: #fff; border: 1px solid var(--vl-border); border-radius: 12px;
	padding: 14px 16px; overflow: hidden;
}
/* Enterprise rule: side-panel headings sit in a brand-coloured band, Title Case. */
body.view-lesson .side-card__title {
	margin: -14px -16px 12px; padding: 9px 14px;
	background: var(--vl-brand); color: #fff;
	font-size: 0.9rem; font-weight: 800;
	display: flex; align-items: center; gap: 8px;
}
body.view-lesson .side-card__title i { color: #fff; }
body.view-lesson .side-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
body.view-lesson .side-list__link {
	display: block; padding: 7px 9px; border-radius: 8px;
	color: var(--vl-ink); text-decoration: none; font-size: 0.95rem; line-height: 1.35;
}
body.view-lesson .side-list__link:hover { background: #eef3ef; color: var(--brand); }
/* In-context catalog nav card (grammar/idiom): grouped, scrollable, current item marked. */
body.view-lesson .side-catalog { max-height: 22rem; overflow-y: auto; }
body.view-lesson .side-catalog__cat { margin: .6rem 0 .15rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; color: #8a9299; }
body.view-lesson .side-catalog .side-list { margin: 0 0 .3rem; }
body.view-lesson .side-list__cur { font-weight: 700; color: var(--brand); padding: .15rem 9px; }
/* CEFR level description chip in the hero + hoverable badges. */
body.view-lesson .gr-view-leveldesc { display: inline-block; margin-left: .35rem; font-size: .85em; color: #4b5563; }
body.view-lesson .gr-view-level[title], body.view-lesson .gr-view-eiken[title],
body.view-lesson .gr-view-leveldesc[title], body.view-lesson .idiom-reg[title] { cursor: help; }
body.view-lesson .side-legend { margin: 0; }
body.view-lesson .side-legend dt { margin: 0 0 4px; }
body.view-lesson .side-legend dd { margin: 0 0 12px; font-size: 0.9rem; color: var(--vl-ink-soft); line-height: 1.5; }
body.view-lesson .side-legend dd:last-child { margin-bottom: 0; }

/* Idiom illustration (student view) + browse-card thumbnail.
   NOTE: legacy viewObject.css styles bare `figure` (display:flex; width:40vw)
   and `img` (width:40vw) and floats figures — override all of it so the
   illustration is an unambiguous centered block with the text stacked below,
   never floated beside it. */
body.view-lesson .id-illustration {
	display: block !important;
	float: none !important;
	clear: both;
	width: auto !important;
	max-width: 360px;
	margin: 4px auto 32px;
	padding: 0;
	text-align: center;
}
body.view-lesson .id-illustration img {
	display: block;
	float: none !important;
	width: 100% !important;
	height: auto;
	margin: 0 auto;
	aspect-ratio: 1 / 1;
	object-fit: contain;
	background: #f4f7f5;
	border-radius: 14px;
	border: 1px solid #dbe4dd;
	box-shadow: 0 6px 18px rgba(17, 40, 25, 0.10);
}
body.view-lesson .lesson-idiom-card__thumb img { width: 100%; aspect-ratio: 4 / 3; height: auto; object-fit: cover; border-radius: 6px; margin-bottom: 6px; }

/* Register (formality) badge — colour-coded so Slang reads as "use with care".
   Shared by the browse cards and the single view. */
body.view-lesson .idiom-reg { display: inline-block; font-size: .72rem; font-weight: 700; padding: 1px 9px; border-radius: 999px; letter-spacing: .02em; }
body.view-lesson .idiom-reg--casual  { background: #e6eefb; color: #28457f; }
body.view-lesson .idiom-reg--neutral { background: #eef1f0; color: #4a5b51; }
body.view-lesson .idiom-reg--formal  { background: #e6f4ec; color: #1e6636; }
body.view-lesson .idiom-reg--slang   { background: #fde9d8; color: #8a3f08; }
/* Card badge row (level + register together). */
body.view-lesson .lesson-idiom-card__badges { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 2px; }
/* Register (formality) filter bar on the browse page. */
body.view-lesson .idiom-filter { display: flex; gap: 8px; align-items: center; margin: 10px 0 2px; font-size: .9rem; color: #4a5b51; }
body.view-lesson .idiom-filter select { padding: 4px 8px; border: 1px solid #cdd6d0; border-radius: 6px; background: #fff; font-size: .9rem; }
body.view-lesson .idiom-filter i { color: var(--brand); }
/* In the single-view metabar the register badge leads; give it a touch more size. */
body.view-lesson .lesson-hero__meta .idiom-reg { font-size: .8rem; padding: 2px 11px; margin-right: 4px; }
body.view-lesson .id-view__literal { display: inline-block; background: #f0faf4; border: 1px solid #cdeeda; color: #14532d; padding: 8px 14px; border-radius: 8px; margin: 0 0 6px; }
body.view-lesson .id-view__literal i { color: var(--brand); margin-right: 6px; }
body.view-lesson .id-view__origin { background: #f6f7f9; border-left: 3px solid #94a3b8; border-radius: 6px; padding: 10px 14px; color: #4a5b51; }

/* ── Grammar practice quiz (fill-in-the-blank) ───────────────────────────────
   Added 2026-07-26 (v6). Student brand green var(--brand). */
body.view-lesson .lesson-btn--quiz { background: var(--brand); border-color: var(--brand); color: #fff; }
body.view-lesson .lesson-btn--quiz:hover { background: #13692f; border-color: #13692f; }

.gqz-overlay {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(20, 30, 24, 0.55);
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
}
.gqz-overlay[hidden] { display: none; }
.gqz-box {
    position: relative; background: #fff; border-radius: 14px;
    width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.3);
}
.gqz-close {
    position: absolute; top: 8px; right: 12px; z-index: 2;
    background: none; border: none; font-size: 1.7rem; line-height: 1;
    color: #999; cursor: pointer; padding: 4px 8px;
}
.gqz-close:hover { color: #333; }
.gqz-body { padding: 30px 26px 26px; }

.gqz-h { margin: 0 0 6px; font-size: 1.35rem; color: var(--brand); }
.gqz-sub, .gqz-count { margin: 0 0 12px; color: #555; }
.gqz-intro, .gqz-result { text-align: center; }
.gqz-count { font-size: 0.85rem; color: #888; }

.gqz-btn {
    display: inline-block; border: 1px solid transparent; border-radius: 8px;
    padding: 10px 22px; font-size: 1rem; font-weight: 600; cursor: pointer;
}
.gqz-btn--primary { background: var(--brand); color: #fff; }
.gqz-btn--primary:hover { background: #13692f; }
.gqz-btn--ghost { background: #fff; border-color: #cbd5cd; color: #333; }
.gqz-btn--ghost:hover { background: #f2f5f3; }

.gqz-progress { height: 6px; background: #e7ede9; border-radius: 999px; overflow: hidden; margin-bottom: 12px; }
.gqz-progress__bar { display: block; height: 100%; background: var(--brand); transition: width 0.25s ease; }
.gqz-qmeta { margin: 0 0 10px; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: #999; }
.gqz-sentence { margin: 0 0 18px; font-size: 1.25rem; line-height: 1.6; color: #1c2b22; }
.gqz-blank { display: inline-block; min-width: 70px; border-bottom: 3px solid var(--brand); vertical-align: baseline; }

.gqz-opts { display: flex; flex-direction: column; gap: 10px; }
.gqz-opt {
    display: block; width: 100%; text-align: left;
    padding: 12px 16px; font-size: 1.05rem;
    background: #fff; border: 2px solid #d7e0d9; border-radius: 10px; cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.gqz-opt:hover:not(:disabled) { border-color: var(--brand); background: #f3f9f5; }
.gqz-opt:disabled { cursor: default; }
.gqz-opt--correct { border-color: var(--brand); background: #eaf7ee; color: #13692f; font-weight: 700; }
.gqz-opt--wrong { border-color: #d64545; background: #fdecec; color: #b02a2a; }

.gqz-feedback { margin-top: 16px; padding: 12px 14px; border-radius: 10px; font-size: 0.95rem; }
.gqz-feedback--ok { background: #eaf7ee; color: #13692f; }
.gqz-feedback--no { background: #fdecec; color: #b02a2a; }
.gqz-fb__head { display: block; font-weight: 600; }
.gqz-fb__head i { margin-right: 5px; }
.gqz-fb__hint { display: block; margin-top: 6px; font-size: 0.85rem; color: #555; }

.gqz-nav { margin-top: 20px; display: flex; gap: 10px; justify-content: center; }

.gqz-scored { margin: 0 0 4px; font-size: 1.1rem; font-weight: 600; color: #1c2b22; }
.gqz-msg { margin: 0 0 6px; color: var(--brand); font-weight: 600; }
.gqz-score-ring {
    width: 120px; height: 120px; border-radius: 50%; margin: 0 auto 16px;
    display: flex; align-items: center; justify-content: center;
    background: conic-gradient(var(--brand) calc(var(--pct) * 1%), #e7ede9 0);
}
.gqz-score-num {
    width: 92px; height: 92px; border-radius: 50%; background: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; font-weight: 700; color: var(--brand);
}
@media (max-width: 480px) {
    .gqz-body { padding: 26px 18px 20px; }
    .gqz-sentence { font-size: 1.1rem; }
}

/* ── Grammar list sidebar: browse-by-level chips + notes ─────────────────────
   Added 2026-07-26 (v6). Student brand green var(--brand). */
body.view-lesson .side-card__lede { margin: 0 0 12px; font-size: 0.85rem; color: var(--vl-ink-soft); }
body.view-lesson .side-card__note {
	margin: 12px 0 0; font-size: 0.78rem; color: var(--vl-ink-soft); line-height: 1.5;
	background: #f4f8f5; border-radius: 8px; padding: 8px 10px;
}
body.view-lesson .side-card__note i { color: var(--brand); margin-right: 4px; }

body.view-lesson .side-levels { display: flex; flex-direction: column; gap: 6px; }
body.view-lesson .side-level {
	display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px 10px;
	width: 100%; text-align: left; cursor: pointer;
	background: #fff; border: 1px solid var(--vl-border); border-radius: 9px;
	padding: 8px 11px; font-family: inherit; color: var(--vl-ink);
	transition: border-color 0.15s, background 0.15s;
}
body.view-lesson .side-level:hover { border-color: var(--brand); background: #f3f9f5; }
body.view-lesson .side-level.is-active { border-color: var(--brand); background: #eaf7ee; }
body.view-lesson .side-level__badge { grid-column: 1; font-weight: 700; font-size: 0.9rem; color: #13692f; white-space: nowrap; }
body.view-lesson .side-level__meaning { grid-column: 2; font-size: 0.78rem; color: var(--vl-ink-soft); }
body.view-lesson .side-level__count {
	grid-column: 3; min-width: 22px; text-align: center;
	font-size: 0.75rem; font-weight: 700; color: var(--brand);
	background: #eaf7ee; border-radius: 999px; padding: 1px 7px;
}
body.view-lesson .side-level--all { grid-template-columns: 1fr auto; font-weight: 700; font-size: 0.9rem; }
body.view-lesson .side-level--all .side-level__count { background: #e7ede9; color: #444; }
body.view-lesson .side-level--all.is-active .side-level__count { background: var(--brand); color: #fff; }

/* On narrow screens the aside drops below; keep the level list compact. */
@media (max-width: 860px) {
	body.view-lesson .side-level__meaning { display: none; }
	body.view-lesson .side-level { grid-template-columns: auto 1fr auto; }
}

/* ── Grammar view: bottom "Ready to practice?" CTA ───────────────────────────
   Added 2026-07-26 (v6). */
body.view-lesson .gr-practice-cta {
	margin: 22px 26px 4px;
	display: flex; align-items: center; justify-content: space-between; gap: 16px;
	flex-wrap: wrap;
	background: linear-gradient(135deg, #eaf7ee 0%, #f4faf6 100%);
	border: 1px solid #cfe8d7; border-radius: 12px;
	padding: 18px 20px;
}
body.view-lesson .gr-practice-cta__text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
body.view-lesson .gr-practice-cta__title { font-size: 1.05rem; font-weight: 800; color: #13692f; }
body.view-lesson .gr-practice-cta__title i { margin-right: 6px; }
body.view-lesson .gr-practice-cta__sub { font-size: 0.88rem; color: var(--vl-ink-soft); }
body.view-lesson .gr-practice-cta .lesson-btn--quiz { flex: 0 0 auto; }
@media (max-width: 560px) {
	body.view-lesson .gr-practice-cta { margin-left: 16px; margin-right: 16px; }
	body.view-lesson .gr-practice-cta .lesson-btn--quiz { width: 100%; justify-content: center; }
}

/* Idiom quiz: the prompt is a question (not a cloze sentence); options are
   longer meaning phrases. Added 2026-07-26 (v6). */
body.view-lesson .gqz-sentence--idiom { font-size: 1.15rem; font-weight: 700; }
body.view-lesson .gqz-opts .gqz-opt { line-height: 1.4; }

/* Idiom list: per-category "Test yourself" button, centered below the idioms.
   Added 2026-07-26 (v6). */
body.view-lesson .cat-quiz-cta { text-align: center; margin: 18px 0 4px; }

/* Idiom quiz results: "add missed idioms to a deck". Added 2026-07-26 (v6). */
body.view-lesson .iqz-missbox { margin: 4px 0 16px; padding: 14px; background: #f4f8f5; border-radius: 10px; }
body.view-lesson .iqz-missbox__title { margin: 0 0 10px; font-size: 0.9rem; font-weight: 700; color: #13692f; }
body.view-lesson .iqz-missbox__title i { margin-right: 5px; }
body.view-lesson .iqz-decks { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
body.view-lesson .iqz-deck {
	border: 1.5px solid #cdd6d0; background: #fff; color: #42525f; border-radius: 20px;
	padding: 7px 14px; font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: 0.12s;
}
body.view-lesson .iqz-deck:hover { border-color: var(--brand); color: var(--brand); }
body.view-lesson .iqz-deck--new { border-style: dashed; color: var(--brand); }

/* ── Guest flashcard deck (idiom catalog) ────────────────────────────────────
   Added 2026-07-26 (v6). Ephemeral flip-through; reuses the .gqz-* modal shell. */
body.view-lesson .fc-stage { display: flex; flex-direction: column; align-items: center; }
body.view-lesson .fc-card {
	width: 100%; max-width: 420px; min-height: 240px; margin: 4px auto 6px;
	perspective: 1200px; cursor: pointer;
}
body.view-lesson .fc-inner {
	position: relative; width: 100%; min-height: 240px;
	transition: transform 0.5s; transform-style: preserve-3d;
}
body.view-lesson .fc-card--flipped .fc-inner { transform: rotateY(180deg); }
body.view-lesson .fc-face {
	position: absolute; inset: 0; -webkit-backface-visibility: hidden; backface-visibility: hidden;
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
	padding: 24px 22px; border-radius: 14px; border: 2px solid #cfe8d7; overflow: auto;
}
body.view-lesson .fc-face--front { background: #eaf7ee; }
body.view-lesson .fc-face--back { background: #fff; transform: rotateY(180deg); }
body.view-lesson .fc-face__tag {
	font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--brand);
}
body.view-lesson .fc-term { font-size: 1.5rem; font-weight: 800; color: #13692f; text-align: center; }
body.view-lesson .fc-mean { font-size: 1.1rem; line-height: 1.5; color: #1c2b22; text-align: center; }
body.view-lesson .fc-hint { font-size: 0.75rem; color: #6b8574; margin-top: 2px; }
body.view-lesson .fc-face .cat-audio-btn { font-size: 1.1rem; }

body.view-lesson .fc-nav { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 8px 0; }
body.view-lesson .fc-arrow {
	width: 42px; height: 42px; border-radius: 50%; border: 1.5px solid #cdd6d0; background: #fff;
	color: var(--brand); font-size: 1rem; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
body.view-lesson .fc-arrow:hover { border-color: var(--brand); background: #f3f9f5; }
body.view-lesson .fc-count { font-size: 0.95rem; font-weight: 700; color: #42525f; min-width: 60px; text-align: center; }
body.view-lesson .fc-tools { display: flex; gap: 10px; justify-content: center; margin-top: 4px; }
