/*
 * Lexi — family site theme (leximobile.com). Mockup C, tile grid:
 * design/references/site-home-c.png. Rules: docs/v2/23-family-site.md §12.3.
 *
 * - Colour lives ONLY in the token blocks below (light, dark by system, dark by
 *   choice). Rules read var(--lx-*); a hex inside a rule is a bug.
 * - Logical properties (inline/block) everywhere — RTL comes for free (§12.3 p5).
 * - Nothing is sized to the English text: tiles and buttons grow (§12.3 p1),
 *   long words wrap (p2), no text-transform (p4 — Greek accents, Turkish i).
 * - Class prefix `lx-` — no bare .nav/.card/.btn (THEMES_GUIDE §11.21).
 */

:root {
	--lx-bg: #FAF6F0;
	--lx-surface: #FFFDF9;
	--lx-surface-2: #F3EDE4;
	--lx-ink: #1C1A17;
	--lx-ink-2: #4A453F;
	--lx-ink-3: #7A736A;
	--lx-line: #E8E0D4;
	--lx-accent: #E2703A;
	--lx-accent-strong: #D4612B;
	--lx-on-accent: #FFFFFF;
	--lx-accent-soft: #FBE3D4;
	--lx-sage: #8FA58A;
	--lx-sage-soft: #E3E8DC;
	--lx-teal: #3E7C7B;
	--lx-teal-soft: #DCE9E6;
	--lx-peach: #F6E7D6;
	--lx-sand: #F4EADD;
	--lx-paper: #FBF5EA;
	/* Paper things (a book page, a flashcard) stay paper in the dark scheme too:
	   their ink is fixed, not --lx-ink, or dark text would turn light on light paper. */
	--lx-paper-ink: #2A241D;
	--lx-paper-ink-2: #6B6259;
	--lx-paper-mark: #F2B48F;
	--lx-paper-tip: #FFFFFF;
	--lx-paper-shadow: 0 2px 0 rgba(0, 0, 0, 0.06), 0 8px 16px rgba(60, 40, 20, 0.12);
	--lx-paper-shadow-lift: 0 2px 0 rgba(0, 0, 0, 0.05), 0 18px 30px rgba(60, 40, 20, 0.18);
	--lx-shadow: 0 1px 2px rgba(60, 40, 20, 0.05), 0 8px 28px rgba(60, 40, 20, 0.07);
	--lx-shadow-lift: 0 2px 4px rgba(60, 40, 20, 0.06), 0 16px 40px rgba(60, 40, 20, 0.12);
	--lx-focus: 0 0 0 3px rgba(226, 112, 58, 0.45);

	--lx-radius: 24px;
	--lx-radius-sm: 14px;
	--lx-gap: clamp(12px, 1.4vw, 20px);
	--lx-pad: clamp(20px, 2.2vw, 32px);
	--lx-max: 1520px;
	--lx-gutter: clamp(16px, 3vw, 40px);

	--lx-font: 'Fira Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
	--lx-font-book: Georgia, 'Times New Roman', serif;

	color-scheme: light;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--lx-bg: #17151A;
		--lx-surface: #221F24;
		--lx-surface-2: #2B272D;
		--lx-ink: #F3EEE7;
		--lx-ink-2: #CFC7BD;
		--lx-ink-3: #9E968C;
		--lx-line: #37323A;
		--lx-accent: #F0814A;
		--lx-accent-strong: #E87538;
		--lx-on-accent: #1A1310;
		--lx-accent-soft: #3D2A20;
		--lx-sage: #9DB598;
		--lx-sage-soft: #263028;
		--lx-teal: #5FA3A1;
		--lx-teal-soft: #1F2E2E;
		--lx-peach: #2E2621;
		--lx-sand: #2A2420;
		--lx-paper: #F4ECDF;
		--lx-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 28px rgba(0, 0, 0, 0.35);
		--lx-shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.35), 0 16px 40px rgba(0, 0, 0, 0.45);
		color-scheme: dark;
	}
}

:root[data-theme="dark"] {
	--lx-bg: #17151A;
	--lx-surface: #221F24;
	--lx-surface-2: #2B272D;
	--lx-ink: #F3EEE7;
	--lx-ink-2: #CFC7BD;
	--lx-ink-3: #9E968C;
	--lx-line: #37323A;
	--lx-accent: #F0814A;
	--lx-accent-strong: #E87538;
	--lx-on-accent: #1A1310;
	--lx-accent-soft: #3D2A20;
	--lx-sage: #9DB598;
	--lx-sage-soft: #263028;
	--lx-teal: #5FA3A1;
	--lx-teal-soft: #1F2E2E;
	--lx-peach: #2E2621;
	--lx-sand: #2A2420;
	--lx-paper: #F4ECDF;
	--lx-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 28px rgba(0, 0, 0, 0.35);
	--lx-shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.35), 0 16px 40px rgba(0, 0, 0, 0.45);
	color-scheme: dark;
}

/* ---------- base ---------- */

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

html { -webkit-text-size-adjust: 100%; }

body.lx {
	margin: 0;
	background: var(--lx-bg);
	color: var(--lx-ink);
	font-family: var(--lx-font);
	font-size: 17px;
	line-height: 1.5;
	overflow-wrap: anywhere;
	-webkit-font-smoothing: antialiased;
}

/* CJK: no spaces between words, so phrase breaking, looser lines, no tracking (§12.3 p3). */
:lang(ja) body.lx, body.lx:lang(ja) { word-break: auto-phrase; line-break: strict; line-height: 1.75; }
:lang(zh) body.lx, body.lx:lang(zh) { line-break: strict; line-height: 1.75; }

/* :where() — zero specificity, so a component class (.lx-btn on an <a>) wins */
:where(.lx) img { max-inline-size: 100%; block-size: auto; display: block; }
:where(.lx) a { color: inherit; }
.lx :focus-visible { outline: none; box-shadow: var(--lx-focus); border-radius: 10px; }

.lx-icon { inline-size: 1.15em; block-size: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lx-icon--sm { inline-size: 0.9em; block-size: 0.9em; }

.lx-wrap {
	max-inline-size: var(--lx-max);
	margin-inline: auto;
	padding-inline: var(--lx-gutter);
}

/* ---------- buttons & pills ---------- */

.lx-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.6em;
	min-block-size: 52px;
	padding: 0.7em 1.6em;
	border: 0;
	border-radius: 999px;
	background: var(--lx-accent-strong);
	color: var(--lx-on-accent);
	font: 700 19px/1.2 var(--lx-font);
	text-decoration: none;
	text-align: center;
	white-space: normal;
	cursor: pointer;
	transition: background-color 0.15s ease, transform 0.15s ease;
}
.lx-btn:hover { background: var(--lx-accent); }
.lx-btn:active { transform: translateY(1px); }
.lx-btn.is-soon { background: var(--lx-surface-2); color: var(--lx-ink-3); cursor: default; }
.lx-btn--sm { min-block-size: 44px; padding: 0.5em 1.3em; font-size: 17px; }
.lx-btn--wide { min-inline-size: min(100%, 290px); }

.lx-pill {
	display: inline-flex;
	align-items: center;
	gap: 0.45em;
	min-block-size: 44px;
	padding: 0.4em 1em;
	border: 1px solid var(--lx-line);
	border-radius: 999px;
	background: var(--lx-surface);
	color: var(--lx-ink);
	font: 600 16px/1.2 var(--lx-font);
	cursor: pointer;
	text-decoration: none;
}
.lx-pill:hover { border-color: var(--lx-ink-3); }
.lx-pill--quiet { background: var(--lx-surface-2); border-color: transparent; }
.lx-pill[aria-expanded="true"] .lx-icon:last-child { transform: rotate(180deg); }

.lx-iconbtn {
	display: inline-grid;
	place-items: center;
	inline-size: 44px;
	block-size: 44px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--lx-ink);
	cursor: pointer;
}
.lx-iconbtn:hover { background: var(--lx-surface-2); }

.lx-badge {
	display: inline-block;
	padding: 0.15em 0.6em;
	border-radius: 999px;
	background: var(--lx-surface-2);
	color: var(--lx-ink-3);
	font-size: 13px;
	font-weight: 600;
	white-space: nowrap;
}

/* ---------- header ---------- */

.lx-header {
	position: sticky;
	inset-block-start: 0;
	z-index: 50;
	background: color-mix(in srgb, var(--lx-bg) 92%, transparent);
	backdrop-filter: saturate(1.2) blur(12px);
	-webkit-backdrop-filter: saturate(1.2) blur(12px);
}

.lx-bar {
	display: flex;
	align-items: center;
	gap: clamp(12px, 2vw, 28px);
	max-inline-size: var(--lx-max);
	margin-inline: auto;
	padding: 14px var(--lx-gutter);
	border-block-end: 1px solid var(--lx-line);
}

.lx-logo {
	font-weight: 800;
	font-size: clamp(30px, 3vw, 40px);
	letter-spacing: -0.03em;
	line-height: 1;
	text-decoration: none;
	color: var(--lx-ink);
	flex: none;
}
.lx .lx-logo:focus-visible { border-radius: 8px; }

.lx-learn, .lx-uilang { position: relative; }
.lx-learn__label { color: var(--lx-ink-3); font-weight: 500; }

.lx-menu {
	display: flex;
	align-items: center;
	gap: clamp(12px, 2vw, 28px);
	flex: 1 1 auto;
	min-inline-size: 0;
}
.lx-menu__end { display: flex; align-items: center; gap: 12px; margin-inline-start: auto; }

.lx-nav ul, .lx-nav ol { display: flex; flex-wrap: wrap; gap: 4px 6px; list-style: none; margin: 0; padding: 0; }
.lx-nav a {
	display: block;
	padding: 0.5em 0.8em;
	border-radius: 12px;
	color: var(--lx-ink);
	font-weight: 500;
	font-size: 17px;
	text-decoration: none;
}
.lx-nav a:hover, .lx-nav a[aria-current] { background: var(--lx-surface-2); }

.lx-burger { display: none; }

/* ---------- panels: dropdown on desktop, bottom sheet on phones ---------- */

.lx-panel {
	position: absolute;
	inset-block-start: calc(100% + 10px);
	inset-inline-start: 0;
	z-index: 60;
	inline-size: min(420px, calc(100vw - 2 * var(--lx-gutter)));
	max-block-size: min(70vh, 560px);
	overflow: auto;
	padding: 18px;
	border: 1px solid var(--lx-line);
	border-radius: var(--lx-radius);
	background: var(--lx-surface);
	box-shadow: var(--lx-shadow-lift);
}
.lx-panel[hidden] { display: none; }
.lx-panel--narrow { inline-size: min(300px, calc(100vw - 2 * var(--lx-gutter))); inset-inline-start: auto; inset-inline-end: 0; }
.lx-panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-block-end: 10px; }
.lx-panel__title { margin: 0; font-weight: 700; font-size: 19px; }

.lx-search {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-block-end: 12px;
	padding: 0 14px;
	border: 1px solid var(--lx-line);
	border-radius: 14px;
	background: var(--lx-bg);
	color: var(--lx-ink-3);
}
.lx-search input {
	flex: 1;
	min-inline-size: 0;
	min-block-size: 46px;
	border: 0;
	background: transparent;
	color: var(--lx-ink);
	font: inherit;
	font-size: 17px;
}
.lx-search input:focus, .lx .lx-search input:focus-visible { outline: none; box-shadow: none; }
.lx-search:focus-within { box-shadow: var(--lx-focus); border-color: transparent; }

.lx-langlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.lx-langlist__row {
	display: flex;
	align-items: center;
	gap: 12px;
	min-block-size: 48px;
	padding: 8px 12px;
	border-radius: 12px;
	text-decoration: none;
	color: var(--lx-ink);
}
button.lx-langlist__row { inline-size: 100%; border: 0; background: transparent; font: inherit; text-align: start; cursor: pointer; }
a.lx-langlist__row:hover, button.lx-langlist__row:hover { background: var(--lx-surface-2); }
.lx-langlist__row.is-current { background: var(--lx-accent-soft); }
.lx-langlist__autonym { font-weight: 600; }
.lx-langlist__name { color: var(--lx-ink-3); }
.lx-langlist__row .lx-badge, .lx-langlist__code { margin-inline-start: auto; }
.lx-langlist__code { color: var(--lx-ink-3); font-size: 14px; font-weight: 600; }
.lx-langlist__empty { margin: 8px 12px; color: var(--lx-ink-3); }

/* ---------- main, crumbs, article ---------- */

.lx-main { min-block-size: 50vh; }

.lx-crumbs .container { max-inline-size: var(--lx-max); margin-inline: auto; padding-inline: var(--lx-gutter); }
.lx-crumbs nav, .lx-crumbs > div { background: transparent !important; }
.lx-crumbs .breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 18px 0 0; font-size: 15px; color: var(--lx-ink-3); }
.lx-crumbs .breadcrumb-item + .breadcrumb-item::before { content: '/'; margin-inline-end: 6px; color: var(--lx-line); }
.lx-crumbs .breadcrumb a { color: var(--lx-ink-3); text-decoration: none; }
.lx-crumbs .breadcrumb a:hover { color: var(--lx-ink); }

.lx-flashes { display: grid; gap: 8px; max-inline-size: var(--lx-max); margin: 16px auto 0; padding-inline: var(--lx-gutter); }
.lx-flash { padding: 14px 18px; border-radius: var(--lx-radius-sm); background: var(--lx-surface); box-shadow: var(--lx-shadow); border-inline-start: 4px solid var(--lx-teal); font-weight: 600; }
.lx-flash--error, .lx-flash--warning { border-inline-start-color: var(--lx-accent-strong); }
.lx-flash--success { border-inline-start-color: var(--lx-sage); }

.lx-article { max-inline-size: 760px; margin-inline: auto; padding: 32px var(--lx-gutter) 72px; }
.lx-article__title { font-size: clamp(34px, 4.4vw, 56px); line-height: 1.08; letter-spacing: -0.02em; font-weight: 800; margin: 0 0 24px; }
.lx-rich { hyphens: auto; } /* long-form text only: in tiles and headings a hyphen reads as a typo (overflow-wrap still saves a word too long for its box) */
.lx-rich h2 { font-size: clamp(26px, 2.6vw, 34px); line-height: 1.15; font-weight: 800; margin: 1.6em 0 0.5em; }
.lx-rich h3 { font-size: 22px; font-weight: 700; margin: 1.4em 0 0.4em; }
.lx-rich p, .lx-rich ul, .lx-rich ol { margin: 0 0 1em; }
.lx-rich a { color: var(--lx-teal); }

/* ---------- home: the tile grid (mockup C) ---------- */

.lx-home { padding-block: clamp(16px, 2.4vw, 28px) clamp(24px, 3vw, 40px); }

.lx-bento {
	display: grid;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	grid-auto-rows: minmax(220px, auto);
	gap: var(--lx-gap);
	max-inline-size: var(--lx-max);
	margin-inline: auto;
	padding-inline: var(--lx-gutter);
}

.lx-tile {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 14px;
	min-inline-size: 0;
	padding: var(--lx-pad);
	border-radius: var(--lx-radius);
	background: var(--lx-surface);
	box-shadow: var(--lx-shadow);
	overflow: hidden;
	isolation: isolate;
	/* Headline sizes follow the TILE, not the window: the longest word of the
	   title has to fit its own box in every language (§12.3 p1–2). */
	container-type: inline-size;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}
a.lx-tile, .lx-tile--link { text-decoration: none; color: inherit; }
.lx-tile--link:hover { box-shadow: var(--lx-shadow-lift); transform: translateY(-2px); }

.lx-tile--test { grid-column: span 5; grid-row: span 2; }
.lx-tile--tenses { grid-column: span 3; grid-row: span 2; background: var(--lx-sage-soft); }
.lx-tile--game { grid-column: span 4; grid-row: span 2; background: var(--lx-sand); }
.lx-tile--reader { grid-column: span 4; grid-row: span 2; background: var(--lx-peach); }
.lx-tile--cards { grid-column: span 4; grid-row: span 2; background: var(--lx-sand); }
.lx-tile--streak { grid-column: span 4; }
.lx-tile--levels { grid-column: span 4; }

.lx-eyebrow {
	margin: 0;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.14em;
	color: var(--lx-ink-2);
}
:lang(ja) .lx-eyebrow, :lang(zh) .lx-eyebrow, :lang(ko) .lx-eyebrow { letter-spacing: 0; }

.lx-tile__title {
	margin: 0;
	font-weight: 800;
	font-size: clamp(26px, 10cqi, 44px);
	line-height: 1.02;
	letter-spacing: -0.025em;
	text-wrap: balance;
}
.lx-tile--test .lx-tile__title { font-size: clamp(32px, 8.6cqi, 64px); }
.lx-tile--tenses .lx-tile__title { font-size: clamp(26px, 12cqi, 44px); }
.lx-tile--streak .lx-tile__title, .lx-tile--levels .lx-tile__title { font-size: clamp(22px, 6cqi, 30px); }

.lx-tile__text { margin: 0; color: var(--lx-ink-2); font-size: 18px; line-height: 1.45; max-inline-size: 34ch; }
.lx-tile__meta { margin: 0; font-size: 20px; color: var(--lx-ink); }
.lx-tile__body { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 12px; max-inline-size: 60%; }
.lx-tile--tenses .lx-tile__body, .lx-tile--game .lx-tile__body,
.lx-tile--reader .lx-tile__body, .lx-tile--cards .lx-tile__body { max-inline-size: none; }
/* the corner arrow sits over the eyebrow line, not over the title */
.lx-tile--link .lx-eyebrow { padding-inline-end: 56px; }
.lx-tile__cta { margin-block-start: auto; position: relative; z-index: 1; }

/* round arrow in the corner */
.lx-arrow {
	position: absolute;
	inset-block-start: var(--lx-pad);
	inset-inline-end: var(--lx-pad);
	z-index: 2;
	display: grid;
	place-items: center;
	inline-size: 48px;
	block-size: 48px;
	border-radius: 50%;
	background: var(--lx-surface);
	color: var(--lx-ink);
	box-shadow: var(--lx-shadow);
}
.lx-arrow .lx-icon { inline-size: 20px; block-size: 20px; }
[dir="rtl"] .lx-arrow .lx-icon { transform: scaleX(-1); }
.lx-tile--link:hover .lx-arrow { background: var(--lx-accent-strong); color: var(--lx-on-accent); }

.lx-tile__art { position: absolute; z-index: 0; pointer-events: none; }

/* test tile: progress ring + kitten on a card stack */
.lx-ring {
	position: absolute;
	inset-block-start: clamp(24px, 3vw, 48px);
	inset-inline-end: clamp(20px, 3vw, 44px);
	inline-size: clamp(130px, 13vw, 200px);
	aspect-ratio: 1;
	display: grid;
	place-items: center;
	text-align: center;
	z-index: 0;
}
.lx-ring svg { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; transform: rotate(-90deg); }
.lx-ring__track { fill: none; stroke: var(--lx-surface-2); stroke-width: 12; }
.lx-ring__value { fill: none; stroke: var(--lx-accent); stroke-width: 12; stroke-linecap: round; }
.lx-ring__label { display: block; color: var(--lx-ink-3); font-size: 15px; }
.lx-ring__number { display: block; font-weight: 800; font-size: clamp(40px, 4.4vw, 64px); line-height: 1; letter-spacing: -0.03em; }

.lx-test-art { inset-block-end: 14px; inset-inline-end: clamp(12px, 3vw, 44px); inline-size: clamp(120px, 12vw, 185px); }

/* stacked paper cards (HTML, not a picture — §11: nothing to break anatomically) */
.lx-stack { display: grid; }
.lx-stack > span {
	grid-area: 1 / 1;
	block-size: 64px;
	border-radius: 14px;
	background: var(--lx-paper);
	box-shadow: var(--lx-paper-shadow);
}
.lx-stack > span:nth-child(1) { background: var(--lx-sage); transform: translate(6%, 26px) rotate(-6deg); }
.lx-stack > span:nth-child(2) { background: var(--lx-accent); transform: translate(2%, 14px) rotate(4deg); }
.lx-stack > span:nth-child(3) { transform: rotate(-2deg); }

/* tenses tile: past – present – future */
.lx-timeline {
	position: relative;
	z-index: 1;
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	margin-block-start: 8px;
	text-align: center;
	list-style: none;
	padding: 0;
}
.lx-timeline::before {
	content: '';
	position: absolute;
	inset-block-start: 11px;
	inset-inline: 4% 4%;
	block-size: 2px;
	background: var(--lx-ink-3);
	opacity: 0.45;
}
.lx-timeline li { position: relative; display: grid; justify-items: center; gap: 4px; }
.lx-timeline li::before {
	content: '';
	inline-size: 24px;
	block-size: 24px;
	border-radius: 50%;
	background: var(--lx-dot, var(--lx-accent));
	box-shadow: 0 0 0 4px var(--lx-sage-soft);
}
.lx-timeline li:nth-child(2) { --lx-dot: var(--lx-teal); }
.lx-timeline li:nth-child(3) { --lx-dot: var(--lx-sage); }
.lx-timeline b { font-weight: 600; font-size: 15px; line-height: 1.25; }
.lx-timeline span { color: var(--lx-ink-2); font-size: 14px; }
.lx-tile--tenses .lx-timeline { margin-block: auto 30%; }

.lx-hills {
	inset-inline: 0;
	inset-block-end: 0;
	block-size: 26%;
	color: var(--lx-sage);
}
.lx-hills svg { inline-size: 100%; block-size: 100%; display: block; }

/* game tile */
.lx-game-art { inset-block-end: 0; inset-inline-end: 0; inline-size: 78%; block-size: 68%; }
.lx-game-art .lx-room {
	position: absolute;
	inset: 18% 0 0 8%;
	border-start-start-radius: 28px;
	background:
		linear-gradient(to top, color-mix(in srgb, var(--lx-accent) 35%, var(--lx-sand)) 0 30%, transparent 30%),
		color-mix(in srgb, var(--lx-sage) 30%, var(--lx-sand));
}
.lx-game-art img { position: absolute; }
.lx-game-art .lx-kitten { inset-block-end: 6%; inset-inline-start: 34%; inline-size: 38%; }
.lx-game-art .lx-prop-1 { inset-block-end: 6%; inset-inline-end: 6%; inline-size: 18%; }
.lx-game-art .lx-prop-2 { inset-block-end: 8%; inset-inline-start: 14%; inline-size: 16%; }

/* reader tile: a page with one word highlighted and its translation */
.lx-book {
	position: relative;
	z-index: 1;
	margin-block-start: auto;
	margin-inline: 4% -10%;
	padding: 26px 30px 70px;
	border-radius: 10px;
	background: var(--lx-paper);
	color: var(--lx-paper-ink);
	font: 400 clamp(20px, 1.8vw, 26px)/1.45 var(--lx-font-book);
	transform: rotate(-6deg);
	box-shadow: var(--lx-paper-shadow-lift);
}
.lx-book mark { background: var(--lx-paper-mark); color: inherit; padding: 0 0.15em; border-radius: 4px; }
.lx-book__tip {
	position: absolute;
	inset-block-end: 18px;
	inset-inline-end: 18%;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 10px 18px;
	border-radius: 12px;
	background: var(--lx-paper-tip);
	color: var(--lx-paper-ink);
	font: 600 17px/1.2 var(--lx-font);
	box-shadow: var(--lx-paper-shadow-lift);
	transform: rotate(6deg);
}

/* cards tile */
.lx-flash-art { inset-block-end: 8%; inset-inline-end: 8%; inline-size: clamp(170px, 17vw, 250px); }
.lx-flash-art .lx-stack > span { block-size: auto; aspect-ratio: 1 / 1.1; border-radius: 18px; }
.lx-flash-art .lx-stack > span:nth-child(1) { transform: translate(18%, -6%) rotate(10deg); }
.lx-flash-art .lx-stack > span:nth-child(2) { transform: translate(9%, -3%) rotate(5deg); }
.lx-flash-art .lx-stack > span:nth-child(3) {
	display: grid;
	place-items: center;
	align-content: center;
	gap: 2px;
	padding: 16px;
	transform: rotate(-4deg);
	color: var(--lx-paper-ink);
	text-align: center;
}
.lx-flash-art img { inline-size: 52%; margin-inline: auto; }
.lx-flash-art b { font-size: clamp(24px, 2.2vw, 32px); font-weight: 700; }
.lx-flash-art i { font-style: normal; color: var(--lx-paper-ink-2); font-size: 17px; }

/* streak tile */
.lx-tile--streak { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 18px; }
.lx-tile--streak .lx-tile__body { max-inline-size: none; }
.lx-tile--streak .lx-days { grid-column: 1 / -1; }
.lx-flame { flex: none; color: var(--lx-accent); }
.lx-flame .lx-icon { inline-size: 54px; block-size: 54px; stroke-width: 1.6; fill: var(--lx-accent-soft); }
.lx-days { display: flex; gap: 6px; margin: 4px 0 0; list-style: none; padding: 0; }
.lx-days li { inline-size: 26px; block-size: 26px; border-radius: 8px; background: var(--lx-surface-2); display: grid; place-items: center; color: var(--lx-on-accent); }
.lx-days li.is-done { background: var(--lx-accent-strong); }
.lx-days .lx-icon { inline-size: 16px; block-size: 16px; stroke-width: 3; }

/* levels tile */
.lx-tile--levels { flex-direction: row; align-items: flex-end; gap: 18px; }
.lx-tile--levels .lx-tile__body { max-inline-size: none; flex: 1 1 auto; }
.lx-levels { display: flex; align-items: flex-end; gap: 6px; list-style: none; margin: 0; padding: 0; flex: none; }
.lx-levels li { display: grid; justify-items: center; gap: 6px; font-size: 13px; color: var(--lx-ink-3); font-weight: 600; }
.lx-levels li::before { content: ''; display: block; inline-size: 22px; block-size: var(--h); border-radius: 6px 6px 3px 3px; background: var(--c); }
.lx-levels li:nth-child(1) { --h: 14px; --c: var(--lx-teal); }
.lx-levels li:nth-child(2) { --h: 24px; --c: color-mix(in srgb, var(--lx-teal) 70%, var(--lx-sage)); }
.lx-levels li:nth-child(3) { --h: 36px; --c: var(--lx-sage); }
.lx-levels li:nth-child(4) { --h: 50px; --c: color-mix(in srgb, var(--lx-sage) 60%, var(--lx-accent)); }
.lx-levels li:nth-child(5) { --h: 64px; --c: color-mix(in srgb, var(--lx-sage) 25%, var(--lx-accent)); }
.lx-levels li:nth-child(6) { --h: 80px; --c: var(--lx-accent); }

/* ---------- footer ---------- */

.lx-footer { border-block-start: 1px solid var(--lx-line); background: var(--lx-bg); }
.lx-footer__inner {
	display: grid;
	grid-template-columns: minmax(200px, 1.4fr) repeat(auto-fit, minmax(160px, 1fr));
	gap: 32px clamp(20px, 3vw, 48px);
	max-inline-size: var(--lx-max);
	margin-inline: auto;
	padding: clamp(32px, 4vw, 56px) var(--lx-gutter);
}
.lx-footer__brand p { margin: 10px 0 0; color: var(--lx-ink-2); max-inline-size: 32ch; }
.lx-footer__title { margin: 0 0 12px; font-weight: 700; font-size: 16px; }
.lx-footer__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.lx-footer__list a { color: var(--lx-ink-2); text-decoration: none; }
.lx-footer__list a:hover { color: var(--lx-ink); text-decoration: underline; }
.lx-footer__list .is-soon { color: var(--lx-ink-3); }
.lx-footer__bottom {
	max-inline-size: var(--lx-max);
	margin-inline: auto;
	padding: 18px var(--lx-gutter) 28px;
	border-block-start: 1px solid var(--lx-line);
	color: var(--lx-ink-3);
	font-size: 15px;
}

/* cookie banner from the engine (default/components/cookie-banner.html) */
.lx .cookie-banner {
	position: fixed;
	inset-inline: 16px;
	inset-block-end: 16px;
	z-index: 80;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 20px;
	max-inline-size: 720px;
	margin-inline: auto;
	padding: 16px 20px;
	border-radius: var(--lx-radius-sm);
	background: var(--lx-surface);
	color: var(--lx-ink);
	box-shadow: var(--lx-shadow-lift);
}
.lx .cookie-banner[hidden], .lx .cookie-banner.is-hidden,
html[data-cookie-consent="granted"] .lx .cookie-banner, html[data-cookie-consent="denied"] .lx .cookie-banner { display: none; }
.lx .cookie-banner__actions { display: flex; gap: 10px; margin-inline-start: auto; }
.lx .cookie-banner .btn { min-block-size: 42px; padding: 0.4em 1.1em; border-radius: 999px; border: 1px solid var(--lx-line); background: var(--lx-surface-2); color: var(--lx-ink); font: 600 15px/1.2 var(--lx-font); cursor: pointer; }
.lx .cookie-banner .btn-primary { background: var(--lx-accent-strong); border-color: transparent; color: var(--lx-on-accent); }

/* ---------- engine forms: sign in, register, password (default/auth/*) ----------
 * The engine's markup is kept (plain POST forms, one place to maintain); only its
 * class names are styled here, and only under the auth pages: Bootstrap is not
 * loaded by this theme, so .row/.btn/.card below are scoped, not global
 * (THEMES_GUIDE §11.21). */

body.lx[class*="auth-"] .lx-main { padding: clamp(16px, 3vw, 40px) var(--lx-gutter) clamp(32px, 5vw, 64px); }

.lx .auth-page {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: var(--lx-gap);
	max-inline-size: 1120px;
	margin-inline: auto;
}
.lx .auth-page__hero {
	position: relative;
	min-block-size: 460px;
	padding: var(--lx-pad);
	border-radius: var(--lx-radius);
	background: var(--lx-sand) url('../images/cat-happy.webp') no-repeat right 6% bottom -12px / min(44%, 240px) auto;
	overflow: hidden;
}
[dir="rtl"] .lx .auth-page__hero { background-position: left 6% bottom -12px; }
.lx .auth-page__hero .site-logo { font-weight: 800; font-size: 34px; letter-spacing: -0.03em; text-decoration: none; }
.lx .auth-page__hero h2 { margin: 28px 0 0; max-inline-size: 12ch; font-weight: 800; font-size: clamp(26px, 2.6vw, 38px); line-height: 1.05; letter-spacing: -0.02em; text-wrap: balance; }
.lx .auth-page__form {
	padding: clamp(24px, 3vw, 44px);
	border-radius: var(--lx-radius);
	background: var(--lx-surface);
	box-shadow: var(--lx-shadow);
}
.lx .auth-page__form h1 { margin: 0 0 6px; font-weight: 800; font-size: clamp(30px, 3vw, 40px); letter-spacing: -0.02em; }
.lx .auth-page__form > p { margin: 0 0 24px; color: var(--lx-ink-2); }

body.lx[class*="auth-"] .row { display: grid; gap: 16px; }
body.lx[class*="auth-"] .kit-label, body.lx[class*="auth-"] .form-label { display: flex; justify-content: space-between; gap: 12px; margin-block-end: 6px; font-weight: 600; font-size: 15px; }
body.lx[class*="auth-"] .form-control {
	inline-size: 100%;
	min-block-size: 50px;
	padding: 0 16px;
	border: 1px solid var(--lx-line);
	border-radius: 14px;
	background: var(--lx-bg);
	color: var(--lx-ink);
	font: inherit;
}
body.lx[class*="auth-"] .form-control:focus { outline: none; border-color: transparent; box-shadow: var(--lx-focus); }
body.lx[class*="auth-"] .form-control.is-invalid { border-color: var(--lx-accent-strong); }
body.lx[class*="auth-"] .form-check { display: flex; align-items: center; gap: 10px; }
body.lx[class*="auth-"] .form-check-input { inline-size: 20px; block-size: 20px; margin: 0; accent-color: var(--lx-accent-strong); }
body.lx[class*="auth-"] .btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
	min-block-size: 52px; padding: 0.6em 1.6em; border: 0; border-radius: 999px;
	background: var(--lx-surface-2); color: var(--lx-ink);
	font: 700 18px/1.2 var(--lx-font); cursor: pointer; white-space: normal;
}
body.lx[class*="auth-"] .btn-primary { background: var(--lx-accent-strong); color: var(--lx-on-accent); }
body.lx[class*="auth-"] .btn-primary:hover { background: var(--lx-accent); }
body.lx[class*="auth-"] .w-100 { inline-size: 100%; }
body.lx[class*="auth-"] .btn-text-link, .lx .auth-page__footer a { color: var(--lx-teal); font-weight: 600; text-decoration: none; }
body.lx[class*="auth-"] .alert { display: flex; gap: 10px; align-items: flex-start; margin-block-end: 16px; padding: 12px 16px; border-radius: var(--lx-radius-sm); background: var(--lx-accent-soft); }
body.lx[class*="auth-"] .icon { inline-size: 1.1em; block-size: 1.1em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; }
.lx .auth-page__divider { display: flex; align-items: center; gap: 12px; margin: 22px 0; color: var(--lx-ink-3); font-size: 15px; }
.lx .auth-page__divider::before, .lx .auth-page__divider::after { content: ''; flex: 1; block-size: 1px; background: var(--lx-line); }
.lx .auth-social { display: grid; gap: 10px; }
.lx .btn-social {
	display: flex; align-items: center; justify-content: center; min-block-size: 50px;
	border: 1px solid var(--lx-line); border-radius: 999px; background: var(--lx-surface);
	color: var(--lx-ink); font-weight: 600; text-decoration: none;
}
.lx .btn-social:hover { border-color: var(--lx-ink-3); }
.lx .auth-page__footer { display: flex; flex-wrap: wrap; gap: 6px; margin-block-start: 22px; color: var(--lx-ink-2); }
.lx .password-strength { block-size: 4px; margin-block-start: 8px; border-radius: 2px; background: var(--lx-surface-2); overflow: hidden; }
.lx .password-strength .bar { block-size: 100%; inline-size: 0; background: var(--lx-accent-strong); transition: inline-size 0.2s ease; }

/* reset-password is the engine's older card markup */
body.lx.auth-reset-password .container { max-inline-size: 460px; margin-inline: auto; padding-block: 24px; }
body.lx.auth-reset-password .card { padding: clamp(24px, 3vw, 36px); border-radius: var(--lx-radius); background: var(--lx-surface); box-shadow: var(--lx-shadow); }
body.lx.auth-reset-password .text-center { text-align: center; }
body.lx.auth-reset-password .text-muted { color: var(--lx-ink-3); }
body.lx.auth-reset-password .mb-1, body.lx.auth-reset-password .mb-3, body.lx.auth-reset-password .mb-4 { margin-block-end: 16px; }
body.lx.auth-reset-password .form-floating { display: flex; flex-direction: column-reverse; gap: 6px; }

@media (max-width: 760px) {
	.lx .auth-page { grid-template-columns: minmax(0, 1fr); }
	.lx .auth-page__hero { min-block-size: 200px; background-size: auto 170px; }
	.lx .auth-page__hero h2 { max-inline-size: 60%; font-size: 26px; }
}

/* ---------- cabinet: the engine's account area (sidebar, profile) + the Lexi pages ----------
 * The engine's sidebar and profile are Bootstrap markup; this theme loads no Bootstrap,
 * so the few classes they use are styled here, scoped to the account pages only. */

body.lx.account-page .lx-main { padding-block: clamp(16px, 3vw, 36px) clamp(32px, 5vw, 64px); }
.lx .account-page .container-xxl { max-inline-size: var(--lx-max); margin-inline: auto; padding-inline: var(--lx-gutter); }
.lx .account-grid { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: var(--lx-gap); align-items: start; }

.lx .account-sidebar { position: sticky; inset-block-start: 96px; padding: 18px; border-radius: var(--lx-radius); background: var(--lx-surface); box-shadow: var(--lx-shadow); }
.lx .account-sidebar__user { display: flex; align-items: center; gap: 12px; padding-block-end: 14px; margin-block-end: 10px; border-block-end: 1px solid var(--lx-line); }
.lx .account-sidebar__avatar { display: grid; place-items: center; inline-size: 44px; block-size: 44px; flex: none; border-radius: 50%; background: var(--lx-accent-soft); color: var(--lx-accent-strong); font-weight: 800; }
.lx .account-sidebar__user-info { min-inline-size: 0; }
.lx .account-sidebar__name { font-weight: 700; }
.lx .account-sidebar__email { color: var(--lx-ink-3); font-size: 14px; overflow-wrap: anywhere; }
.lx .account-sidebar__toggle { display: none; margin-inline-start: auto; border: 0; background: transparent; color: var(--lx-ink); }
.lx .account-sidebar nav { display: grid; gap: 2px; }
.lx .account-sidebar nav a { display: flex; align-items: center; gap: 10px; min-block-size: 44px; padding: 8px 12px; border-radius: 12px; color: var(--lx-ink); text-decoration: none; font-weight: 500; }
.lx .account-sidebar nav a:hover { background: var(--lx-surface-2); }
.lx .account-sidebar nav a.is-active { background: var(--lx-accent-soft); font-weight: 700; }
.lx .account-sidebar nav .divider { block-size: 1px; margin: 8px 0; background: var(--lx-line); }
.lx .account-sidebar nav .logout { color: var(--lx-ink-3); }
.lx .account-page .icon { inline-size: 1.15em; block-size: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.lx-cab { display: grid; gap: 18px; }
.lx-cab__title { margin: 0; font-weight: 800; font-size: clamp(28px, 3vw, 40px); letter-spacing: -0.02em; }
.lx-cab__subtitle { margin: 0 0 8px; font-weight: 700; font-size: 22px; }
.lx-cab__card { padding: var(--lx-pad); border-radius: var(--lx-radius); background: var(--lx-surface); box-shadow: var(--lx-shadow); }
.lx-cab__card--danger { box-shadow: inset 0 0 0 2px var(--lx-accent-soft), var(--lx-shadow); }
.lx-cab__list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.lx-cab__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 16px 20px; border-radius: var(--lx-radius-sm); background: var(--lx-surface); box-shadow: var(--lx-shadow); }
.lx-cab__row > span:first-child { display: grid; gap: 2px; }
.lx-cab__name { font-weight: 800; font-size: 19px; }
.lx-cab__text { margin: 0; color: var(--lx-ink-2); }
.lx-cab__muted { margin: 0; color: var(--lx-ink-3); font-size: 15px; }
.lx-cab__stat { margin: 0; font-weight: 700; font-size: 20px; }
.lx-cab__apps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--lx-gap); }
.lx-cab__app { display: flex; flex-direction: column; gap: 10px; padding: var(--lx-pad); border-radius: var(--lx-radius); background: var(--lx-surface); box-shadow: var(--lx-shadow); }
.lx-cab__app .lx-pill { align-self: flex-start; margin-block-start: auto; }
.lx-cab__app-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.lx-cab__form { display: grid; gap: 10px; max-inline-size: 460px; margin-block-start: 14px; }
.lx-cab__label { font-weight: 600; font-size: 15px; }
.lx-cab__input { min-block-size: 50px; padding: 0 16px; border: 1px solid var(--lx-line); border-radius: 14px; background: var(--lx-bg); color: var(--lx-ink); font: inherit; }
.lx-cab__input:focus { outline: none; border-color: transparent; box-shadow: var(--lx-focus); }
.lx-badge--on { background: var(--lx-accent-soft); color: var(--lx-accent-strong); }
.lx-btn--danger { justify-self: start; }

/* the engine's profile page (default/site/account/profile.html) */
body.lx.account-page .row { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--lx-gap); }
body.lx.account-page .card { border-radius: var(--lx-radius); background: var(--lx-surface); box-shadow: var(--lx-shadow); overflow: hidden; }
body.lx.account-page .card-header { padding: 18px var(--lx-pad) 0; }
body.lx.account-page .card-title, body.lx.account-page h4 { margin: 0; font-weight: 800; }
body.lx.account-page h4 { font-size: clamp(28px, 3vw, 40px); letter-spacing: -0.02em; margin-block-end: 18px; }
body.lx.account-page .card-body { padding: 14px var(--lx-pad) var(--lx-pad); }
body.lx.account-page .mb-3 { margin-block-end: 14px; }
body.lx.account-page .mt-4 { margin-block-start: var(--lx-gap); }
body.lx.account-page .form-label { display: block; margin-block-end: 6px; font-weight: 600; font-size: 15px; }
body.lx.account-page .form-control, body.lx.account-page .form-select { inline-size: 100%; min-block-size: 48px; padding: 0 14px; border: 1px solid var(--lx-line); border-radius: 14px; background: var(--lx-bg); color: var(--lx-ink); font: inherit; }
body.lx.account-page .form-control:disabled { color: var(--lx-ink-3); }
body.lx.account-page .form-control:focus, body.lx.account-page .form-select:focus { outline: none; border-color: transparent; box-shadow: var(--lx-focus); }
body.lx.account-page .btn { display: inline-flex; align-items: center; gap: 8px; min-block-size: 46px; padding: 0.5em 1.3em; border: 1px solid var(--lx-line); border-radius: 999px; background: var(--lx-surface-2); color: var(--lx-ink); font: 700 16px/1.2 var(--lx-font); cursor: pointer; text-decoration: none; }
body.lx.account-page .btn-primary { border-color: transparent; background: var(--lx-accent-strong); color: var(--lx-on-accent); }
body.lx.account-page .btn-sm { min-block-size: 38px; font-size: 14px; }
body.lx.account-page .list-group { display: grid; gap: 8px; }
body.lx.account-page .list-group-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--lx-bg); }
body.lx.account-page .text-muted { color: var(--lx-ink-3); }
body.lx.account-page .d-inline { display: inline; }
body.lx.account-page .badge { padding: 0.15em 0.6em; border-radius: 999px; background: var(--lx-surface-2); font-size: 13px; }

@media (max-width: 900px) {
	.lx .account-grid { grid-template-columns: minmax(0, 1fr); }
	.lx .account-sidebar { position: static; }
}

/* «this site is in your language» — a quiet strip under the header, not a modal */
.lx-suggest {
	position: fixed;
	inset-inline: 16px;
	inset-block-start: 88px;
	z-index: 75;
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto auto;
	align-items: center;
	gap: 10px 12px;
	max-inline-size: 560px;
	margin-inline: auto;
	padding: 12px 12px 12px 20px;
	border-radius: var(--lx-radius-sm);
	background: var(--lx-surface);
	box-shadow: var(--lx-shadow-lift);
}
.lx-suggest[hidden] { display: none; }
.lx-suggest__text { margin: 0; font-weight: 600; }
@media (max-width: 520px) {
	.lx-suggest { grid-template-columns: minmax(0, 1fr) auto; }
	.lx-suggest__text { grid-column: 1 / -1; }
	.lx-suggest .lx-btn { justify-self: start; }
}

/* ---------- responsive ---------- */

@media (max-width: 1180px) {
	.lx-bento { grid-template-columns: repeat(6, minmax(0, 1fr)); }
	.lx-tile--test { grid-column: span 6; }
	.lx-tile--tenses, .lx-tile--game, .lx-tile--reader, .lx-tile--cards,
	.lx-tile--streak, .lx-tile--levels { grid-column: span 3; }
}

@media (max-width: 960px) {
	.lx-burger { display: inline-grid; margin-inline-start: auto; }
	.lx-menu {
		position: absolute;
		inset-block-start: 100%;
		inset-inline: 0;
		display: none;
		flex-direction: column;
		align-items: stretch;
		gap: 16px;
		padding: 16px var(--lx-gutter) 24px;
		background: var(--lx-bg);
		border-block-end: 1px solid var(--lx-line);
		box-shadow: var(--lx-shadow);
	}
	.lx-menu.is-open { display: flex; }
	.lx-nav ul, .lx-nav ol { flex-direction: column; }
	.lx-nav a { padding: 0.8em 0.6em; font-size: 19px; }
	.lx-menu__end { margin-inline-start: 0; flex-direction: column; align-items: stretch; }
	/* inside the open menu a panel unfolds in place: there is no room to float it */
	.lx-menu .lx-panel { position: static; inline-size: auto; max-block-size: none; margin-block-start: 8px; box-shadow: none; }
	.lx-menu .lx-uilang__toggle { align-self: flex-start; }
	.lx-learn__label { display: none; }
	.lx-bar { position: relative; }
}

@media (max-width: 680px) {
	body.lx { font-size: 16px; }
	.lx-bento { grid-template-columns: minmax(0, 1fr); grid-auto-rows: auto; }
	.lx-bento > .lx-tile { grid-column: auto; grid-row: auto; min-block-size: 0; }
	.lx-tile--test { padding-block-end: 220px; }
	.lx-tile__body { max-inline-size: 100%; }
	.lx-ring { inset-block-start: auto; inset-block-end: 24px; inset-inline-end: auto; inset-inline-start: var(--lx-pad); inline-size: 150px; }
	.lx-test-art { inline-size: 150px; }
	.lx-tile--tenses { padding-block-end: 120px; }
	.lx-tile--tenses .lx-timeline { margin-block: 8px 0; }
	.lx-tile--game { padding-block-end: 240px; }
	.lx-game-art { inline-size: 100%; block-size: 220px; }
	.lx-footer__inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
	.lx-footer__brand { grid-column: 1 / -1; }
	.lx-tile--cards { padding-block-end: 250px; }
	.lx-tile--reader .lx-book { margin-inline: 0; }
	.lx-tile--streak, .lx-tile--levels { flex-wrap: wrap; }
	.lx-days { margin-inline-start: 0; }

	/* the «what I learn» window becomes a sheet from the bottom (23 §12.2) */
	.lx-learn .lx-panel {
		position: fixed;
		inset-block-start: auto;
		inset-block-end: 0;
		inset-inline: 0;
		inline-size: auto;
		max-block-size: 80vh;
		border-radius: var(--lx-radius) var(--lx-radius) 0 0;
	}
}

/* ---------- grammar topic (24 §3.1) ---------- */

.lx-sr { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.lx-topic { max-inline-size: 860px; margin-inline: auto; padding: 24px var(--lx-gutter) 80px; }
.lx-topic__head { margin-block-end: 8px; }
.lx-topic__eyebrow { margin: 0 0 10px; color: var(--lx-teal); font-weight: 700; font-size: 15px; }
.lx-topic__title { margin: 0 0 16px; font-size: clamp(32px, 4.4vw, 52px); line-height: 1.08; letter-spacing: -0.02em; font-weight: 800; }
.lx-topic__lead { margin: 0 0 22px; font-size: clamp(19px, 1.7vw, 22px); color: var(--lx-ink-2); hyphens: auto; }
.lx-topic__toc { display: flex; flex-wrap: wrap; gap: 8px; }
.lx-topic__toc a { padding: 6px 14px; border-radius: 999px; background: var(--lx-surface-2); font-weight: 600; font-size: 15px; text-decoration: none; }
.lx-topic__toc a:hover { background: var(--lx-accent-soft); }

.lx-topic__section { margin-block-start: 48px; scroll-margin-block-start: 96px; }
.lx-topic__section h2 { margin: 0 0 18px; font-size: clamp(26px, 2.6vw, 34px); line-height: 1.15; font-weight: 800; }
.lx-topic__section h3 { margin: 26px 0 10px; font-size: 21px; font-weight: 700; }
.lx-topic__note { margin: 12px 0 0; color: var(--lx-ink-2); hyphens: auto; }

.lx-forms { overflow-x: auto; border-radius: var(--lx-radius-sm); background: var(--lx-surface); box-shadow: var(--lx-shadow); }
.lx-forms__table { inline-size: 100%; border-collapse: collapse; font-size: 17px; }
.lx-forms__table th, .lx-forms__table td { padding: 12px 16px; text-align: start; vertical-align: top; overflow-wrap: normal; }
.lx-forms__table thead th { background: var(--lx-sage-soft); font-size: 14px; font-weight: 700; color: var(--lx-ink-2); }
.lx-forms__table tbody tr + tr > * { border-block-start: 1px solid var(--lx-line); }
.lx-forms__table tbody th { font-weight: 700; color: var(--lx-teal); white-space: nowrap; }
.lx-forms__table td { min-inline-size: 9em; }

.lx-topic__rules { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.lx-topic__rules li { display: grid; gap: 2px; padding: 12px 16px; border-radius: var(--lx-radius-sm); background: var(--lx-surface-2); }
.lx-topic__examples { color: var(--lx-ink-2); font-weight: 600; }

.lx-topic__uses { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: var(--lx-gap); }
.lx-topic__use { padding: 20px 22px; border-radius: var(--lx-radius-sm); background: var(--lx-surface); box-shadow: var(--lx-shadow); }
.lx-topic__use h3 { margin: 0 0 6px; font-size: 19px; }
.lx-topic__use p { margin: 0 0 10px; color: var(--lx-ink-2); hyphens: auto; }
.lx-topic__samples { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.lx-topic__samples li { display: grid; gap: 1px; padding-inline-start: 12px; border-inline-start: 3px solid var(--lx-sage); }
.lx-topic__sample { font-weight: 600; }
.lx-topic__gloss { color: var(--lx-ink-3); font-size: 15px; }

.lx-topic__markers { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.lx-topic__markers li { padding: 5px 12px; border-radius: 999px; background: var(--lx-teal-soft); font-weight: 600; font-size: 15px; }

.lx-topic__mistakes { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.lx-topic__mistakes li { padding: 16px 20px; border-radius: var(--lx-radius-sm); background: var(--lx-surface); box-shadow: var(--lx-shadow); }
.lx-topic__mistakes li > p { margin: 0; color: var(--lx-ink-2); hyphens: auto; }
.lx-topic__mistakes .lx-topic__pair { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-block-end: 6px; color: var(--lx-ink); font-weight: 700; }
.lx-topic__wrong { color: var(--lx-accent-strong); text-decoration-thickness: 2px; }
.lx-topic__right::before { content: '✓ '; color: var(--lx-sage); }

.lx-topic__section--test { padding: var(--lx-pad); border-radius: var(--lx-radius); background: var(--lx-sand); }
.lx-topic__section--test .lx-topic__note { margin: -8px 0 16px; }

.lx-topic__next ul { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: var(--lx-gap); margin: 0; padding: 0; list-style: none; }
.lx-topic__next a { display: grid; gap: 4px; padding: 18px 22px; border-radius: var(--lx-radius-sm); background: var(--lx-surface); box-shadow: var(--lx-shadow); font-weight: 800; font-size: 19px; text-decoration: none; transition: box-shadow 0.15s ease; }
.lx-topic__next a:hover { box-shadow: var(--lx-shadow-lift); }
.lx-topic__next-label { color: var(--lx-ink-3); font-weight: 600; font-size: 14px; }

.lx-topic__faq { display: grid; gap: 10px; }
.lx-topic__faq details { padding: 14px 20px; border-radius: var(--lx-radius-sm); background: var(--lx-surface); box-shadow: var(--lx-shadow); }
.lx-topic__faq summary { font-weight: 700; cursor: pointer; }
.lx-topic__faq details p { margin: 10px 0 0; color: var(--lx-ink-2); hyphens: auto; }

/* pair hub and section contents (24 §3 types 2–3) */
.lx-hub__paths { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: var(--lx-gap); margin-block-start: 32px; }
.lx-hub__path { padding: var(--lx-pad); border-radius: var(--lx-radius); background: var(--lx-sage-soft); }
.lx-hub__path--alt { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; background: var(--lx-sand); }
.lx-hub__path h2 { margin: 0 0 14px; font-size: clamp(24px, 2.4vw, 30px); font-weight: 800; }
.lx-hub__path--alt h2, .lx-hub__path--alt p { margin: 0; }
.lx-hub__path--alt .lx-btn { margin-block-start: auto; }
.lx-steps { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; counter-reset: lx-step; }
.lx-steps__item { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 12px 16px; border-radius: var(--lx-radius-sm); background: var(--lx-surface); counter-increment: lx-step; font-weight: 700; }
.lx-steps__item::before { content: counter(lx-step); display: grid; place-items: center; inline-size: 26px; block-size: 26px; border-radius: 50%; background: var(--lx-surface-2); color: var(--lx-ink-2); font-size: 13px; }
.lx-steps__item a { text-decoration: none; }
.lx-steps__item a::after { content: " →"; color: var(--lx-teal); }
.lx-steps__item a:hover { color: var(--lx-teal); text-decoration: underline; text-underline-offset: 3px; }
.lx-steps__item.is-soon { color: var(--lx-ink-3); }
.lx-steps__min { margin-inline-start: auto; color: var(--lx-ink-3); font-weight: 600; font-size: 14px; }
.lx-steps--index { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.lx-steps--index .lx-steps__item { box-shadow: var(--lx-shadow); }
.lx-hub__sections { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; list-style: none; }
.lx-hub__sections a, .lx-hub__sections .is-soon { display: inline-flex; align-items: center; gap: 8px; min-block-size: 46px; padding: 0.4em 1.2em; border-radius: 999px; background: var(--lx-surface); box-shadow: var(--lx-shadow); font-weight: 700; text-decoration: none; }
.lx-hub__sections a:hover { box-shadow: var(--lx-shadow-lift); }
.lx-hub__sections .is-soon { box-shadow: none; background: var(--lx-surface-2); color: var(--lx-ink-3); }
.lx-hub__app { display: grid; gap: 4px; padding: 18px 22px; border-radius: var(--lx-radius-sm); background: var(--lx-surface-2); font-weight: 800; font-size: 19px; }

/* exercise (24 §6): the server prints every task; exercise.js marks the box .is-live */
.lx-ex__list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; counter-reset: lx-ex; }
.lx-ex__item { position: relative; padding: 16px 20px 16px 56px; border-radius: var(--lx-radius-sm); background: var(--lx-surface); box-shadow: var(--lx-shadow); counter-increment: lx-ex; }
.lx-ex__item::before { content: counter(lx-ex); position: absolute; inset-inline-start: 16px; inset-block-start: 16px; display: grid; place-items: center; inline-size: 28px; block-size: 28px; border-radius: 50%; background: var(--lx-surface-2); color: var(--lx-ink-2); font-weight: 700; font-size: 14px; }
.lx-ex__item[data-state="right"] { box-shadow: inset 0 0 0 2px var(--lx-sage), var(--lx-shadow); }
.lx-ex__item[data-state="right"]::before { background: var(--lx-sage); color: var(--lx-on-accent); content: '✓'; }
.lx-ex__item[data-state="wrong"] { box-shadow: inset 0 0 0 2px var(--lx-accent-soft), var(--lx-shadow); }
.lx-ex__item[data-state="wrong"]::before { background: var(--lx-accent-strong); color: var(--lx-on-accent); }
.lx-ex__form { display: grid; gap: 10px; margin: 0; }
.lx-ex__text { margin: 0; font-size: 19px; line-height: 1.9; }
.lx-ex__hint { margin: 0; color: var(--lx-teal); font-weight: 700; }
.lx-ex__base { color: var(--lx-ink-3); }
.lx-ex__gap { display: inline-block; min-inline-size: 3em; padding-inline: 4px; border-block-end: 2px solid var(--lx-ink-3); text-align: center; font-weight: 700; }
.lx-ex__input { inline-size: 9em; max-inline-size: 100%; min-block-size: 40px; margin-inline: 4px; padding: 0 10px; border: 1px solid var(--lx-line); border-radius: 10px; background: var(--lx-bg); color: var(--lx-ink); font: 600 18px/1.2 var(--lx-font); }
.lx-ex__input--line { inline-size: 100%; margin-inline: 0; min-block-size: 48px; }
.lx-ex__input:focus { outline: none; border-color: transparent; box-shadow: var(--lx-focus); }
.lx-ex__input:disabled { color: var(--lx-ink-2); }
.lx-ex__options, .lx-ex__chunks { display: flex; flex-wrap: wrap; gap: 8px; }
.lx-ex__option, .lx-ex__chunk { min-block-size: 44px; padding: 0.4em 1.1em; border: 1px solid var(--lx-line); border-radius: 999px; background: var(--lx-bg); color: var(--lx-ink); font: 600 17px/1.2 var(--lx-font); cursor: pointer; }
.lx-ex__option:hover:not(:disabled), .lx-ex__chunk:hover:not(:disabled) { border-color: var(--lx-ink-3); }
.lx-ex__option:disabled, .lx-ex__chunk:disabled { cursor: default; }
.lx-ex__item[data-state="right"] .lx-ex__option.is-picked { background: var(--lx-sage-soft); border-color: var(--lx-sage); }
.lx-ex__item[data-state="wrong"] .lx-ex__option.is-picked { background: var(--lx-accent-soft); border-color: var(--lx-accent-strong); }
.lx-ex__built { display: flex; flex-wrap: wrap; gap: 8px; min-block-size: 52px; margin: 0; padding: 4px; border-block-end: 2px dashed var(--lx-line); }
.lx-ex__built .lx-ex__chunk { background: var(--lx-teal-soft); border-color: transparent; }
.lx-ex__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.lx-ex__skip { padding: 0; border: 0; background: none; color: var(--lx-ink-3); font: 600 15px/1.2 var(--lx-font); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.lx-ex__item[data-state] .lx-ex__actions { display: none; }
.lx-ex:not(.is-live) .lx-ex__actions { display: none; }
.lx-ex__verdict { margin: 8px 0 0; font-weight: 700; }
.lx-ex__verdict:empty { display: none; }
.lx-ex__item[data-state="right"] .lx-ex__verdict { color: var(--lx-sage); }
.lx-ex__item[data-state="wrong"] .lx-ex__verdict { color: var(--lx-accent-strong); }
.lx-ex__right { margin: 4px 0 0; font-weight: 600; }
.lx-ex__right span { color: var(--lx-teal); font-weight: 800; }
.lx-ex__why { margin: 4px 0 0; color: var(--lx-ink-2); hyphens: auto; }
.lx-ex__result { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-block-start: 16px; padding: 18px 22px; border-radius: var(--lx-radius-sm); background: var(--lx-surface); box-shadow: var(--lx-shadow-lift); }
.lx-ex__result[hidden] { display: none; }
.lx-ex__score { margin: 0; font-weight: 800; font-size: 22px; }

/* trainer (24 §3.2): the server prints the first task; trainer.js swaps the next ones into the same card */
.lx-tr { display: grid; gap: 14px; }
.lx-tr [hidden] { display: none !important; }
.lx-tr__hint { margin: 0; color: var(--lx-ink-2); }
.lx-tr__bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; color: var(--lx-ink-3); font-weight: 700; font-size: 15px; }
.lx-tr__bar:empty, .lx-tr:not(.is-live) .lx-tr__bar { display: none; }
.lx-tr__tally { color: var(--lx-sage); }
.lx-tr__card { display: grid; gap: 16px; margin: 0; padding: var(--lx-pad); border-radius: var(--lx-radius-sm); background: var(--lx-surface); box-shadow: var(--lx-shadow-lift); }
.lx-tr__card[data-state="right"] { box-shadow: inset 0 0 0 2px var(--lx-sage), var(--lx-shadow-lift); }
.lx-tr__card[data-state="wrong"] { box-shadow: inset 0 0 0 2px var(--lx-accent-soft), var(--lx-shadow-lift); }
.lx-tr__verb { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin: 0; }
.lx-tr__base { font-weight: 800; font-size: clamp(30px, 4vw, 40px); line-height: 1.1; color: var(--lx-ink); }
.lx-tr__gloss { color: var(--lx-ink-2); font-size: 18px; }
.lx-tr__fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 14px; }
.lx-tr__field { display: grid; gap: 6px; align-content: start; }
.lx-tr__label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-weight: 700; }
.lx-tr__label small { color: var(--lx-ink-3); font-weight: 600; font-size: 14px; }
.lx-tr__field[data-state="right"] .lx-ex__input { border-color: var(--lx-sage); background: var(--lx-sage-soft); }
.lx-tr__field[data-state="wrong"] .lx-ex__input { border-color: var(--lx-accent-strong); background: var(--lx-accent-soft); }
.lx-tr__answer { margin: 0; font-weight: 600; }
.lx-tr__answer span { color: var(--lx-teal); font-weight: 800; }
.lx-tr__verdict { margin: 0; font-weight: 700; }
.lx-tr__verdict:empty { display: none; }
.lx-tr__card[data-state="right"] .lx-tr__verdict { color: var(--lx-sage); }
.lx-tr__card[data-state="wrong"] .lx-tr__verdict { color: var(--lx-accent-strong); }
.lx-tr__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.lx-tr:not(.is-live) .lx-tr__actions, .lx-tr:not(.is-live) .lx-tr__settings { display: none; }
.lx-tr__result { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-radius: var(--lx-radius-sm); background: var(--lx-surface); box-shadow: var(--lx-shadow-lift); }
.lx-tr__again { display: flex; flex-wrap: wrap; gap: 10px; }
.lx-tr__settings { border-radius: var(--lx-radius-sm); background: var(--lx-surface-2); }
.lx-tr__settings summary { padding: 12px 18px; font-weight: 700; cursor: pointer; }
.lx-tr__options { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 12px 24px; margin: 0; padding: 0 18px 16px; }
.lx-tr__options fieldset { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; }
.lx-tr__options legend { margin-block-end: 6px; padding: 0; color: var(--lx-ink-2); font-weight: 700; font-size: 14px; }
.lx-tr__options label { display: flex; align-items: center; gap: 8px; min-block-size: 32px; cursor: pointer; }
.lx-tr__options input { accent-color: var(--lx-accent); inline-size: 18px; block-size: 18px; }
.lx-tr__count { color: var(--lx-ink-3); font-size: 14px; }

/* verbs table: one tbody per level. Its own vertical scroll only on wide screens —
   on a phone a scroll inside a scroll traps the swipe */
@media (min-width: 900px) {
	.lx-verbs { max-block-size: min(80vh, 900px); overflow-y: auto; }
	.lx-verbs thead th { position: sticky; inset-block-start: 0; z-index: 1; }
}
.lx-verbs .lx-forms__table td { min-inline-size: 7em; }
.lx-verbs .lx-verbs__level th { background: var(--lx-surface-2); color: var(--lx-ink-2); font-size: 14px; }
.lx-verbs__gloss { color: var(--lx-ink-2); }

@media (max-width: 640px) {
	.lx-verbs .lx-forms__table { font-size: 15px; }
	.lx-verbs .lx-forms__table th, .lx-verbs .lx-forms__table td { padding: 10px 8px; min-inline-size: 0; }
	.lx-ex__item { padding: 14px 16px 14px 48px; }
	.lx-ex__item::before { inset-inline-start: 12px; inset-block-start: 14px; }
	.lx-ex__text { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
	.lx *, .lx *::before, .lx *::after { transition: none !important; animation: none !important; }
}
