.lt-inventory {
  /* The body itself is now --bg-ultra-light, so this band needs a different
   surface to read as a band at all. A faint brand tint that inverts in step
   with its text keeps it distinct in both schemes. */
background: var(--primary-ultra-light);
color: var(--text-dark);

.lt-inventory__list {
	display: grid;
	gap: var(--space-m);
	margin-block: var(--space-l) 0;
}

.lt-inventory__term {
	font-size: var(--text-l);
	font-weight: 600;
	margin-block: 0 var(--space-xxs, var(--space-xs));
}

.lt-inventory__desc {
	color: var(--text-color);
	max-inline-size: 68ch;
	margin-block: 0;
	padding-block-end: var(--space-m);
	border-block-end: 1px solid var(--base-light);
}

/* The number carries weight and colour, but stays inside its sentence so the
   section reads as an inventory rather than a dashboard.

   --primary-dark rather than --primary for the same reason the links use it:
   --primary is one lightness in both schemes and measured 3.41:1 here against
   the dark band. */
.lt-inventory__n {
	color: var(--primary-dark);
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

@media (width >= 48rem) {
	.lt-inventory__list { grid-template-columns: var(--grid-2); column-gap: var(--space-xl); }
}
}
.lt-play {
  display: grid;
/* minmax(0, 1fr), as on .lt-lesson: a grid item defaults to min-width:auto, so a
   wide .lt-table with nowrap cells pushed this column past the phone's edge and
   the whole page scrolled sideways. */
grid-template-columns: minmax(0, 1fr);
gap: var(--content-gap);

.lt-play__title { margin: 0; }

/* Players, length, other names: the strip you read before sitting down, so it is
   boxed to read as apparatus rather than as prose. Same treatment as the dish
   facts, because it does the same job. */
.lt-play__meta {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-xs) var(--space-s);
	padding: var(--space-s);
	background: var(--bg-ultra-light);
	border: 1px solid var(--base-light);
	border-radius: var(--radius);
	font-size: var(--text-s);
}

.lt-play__fact {
	margin: 0;

	& .lt-lesson__label { display: block; }
}

/* The argument for the game: what Thai an evening of it forces on you. Set off by
   a rule rather than a box, so it does not compete with the facts strip. */
.lt-play__why {
	padding-inline-start: var(--space-s);
	border-inline-start: 3px solid var(--base-light);
	font-size: var(--text-s);
	/* The field is a textarea dropped straight into this div rather than wrapped in
	   a <p>, so that :empty can collapse it. That means the line breaks have to be
	   honoured here rather than on a child. */
	white-space: pre-line;

	&:empty { display: none; }

	& > :first-child { margin-block-start: 0; }
	& > :last-child { margin-block-end: 0; }
}

/* Setup, the round, the phrase table, the listening table. Etch has no
   conditionals, so each of these fields carries its OWN heading and the wrapper
   collapses when the field is unfilled — otherwise a half-written game would
   render a column of headings with nothing underneath. */
.lt-play__section {
	display: grid;
	gap: var(--space-xs);

	&:empty { display: none; }

	& > :first-child { margin-block-start: 0; }
	& > :last-child { margin-block-end: 0; }
}

.lt-play__body p { margin: 0; white-space: pre-line; }
}
.lt-crumb {
  margin: 0;
font-size: var(--text-s);
font-weight: 600;

& a {
	/* The inherited ACSS link colour measured 3.42:1 in DARK mode, below AA.
	   This token is light-dark(), so it passes in both schemes. */
	color: var(--primary-semi-dark);
	/* Comfortable tap target without changing how it looks. */
	display: inline-flex;
	align-items: center;
	min-block-size: 44px;
}
}
.lt-ladder {
  display: grid;
gap: var(--space-s);

.lt-ladder__step {
	display: grid;
	gap: var(--space-xs);
	padding: var(--space-s);
	background: var(--bg-ultra-light);
	border: 1px solid var(--base-light);
	border-radius: var(--radius);

	& h3 {
		margin: 0;
		font-size: var(--text-m);
		display: flex;
		align-items: center;
		gap: var(--space-xs);
	}

	& p { margin: 0; white-space: pre-line; }
}

.lt-ladder__badge {
	padding-inline: var(--space-xs);
	font-size: var(--text-xs);
	font-weight: 600;
	color: var(--primary-ultra-light);
	background: var(--primary-semi-dark);
	border-radius: var(--radius);
	white-space: nowrap;
}
}
:root > body {
  background-color: var(--bg-ultra-light);
color: var(--bg-ultra-light-text);

/* LINK COLOUR. ACSS defaults --link-color to --primary, which is deliberately
   the same lightness in both schemes (L 0.52). One value cannot clear 4.5:1
   against both an off-white and a near-black surface, and it measured 3.43:1 on
   the dark one: every link on the site failed. --primary-dark is a light-dark()
   pair (L 0.32 / 0.86) and clears the threshold either way, and the hover state
   steps further from the surface rather than closer to it.

   These sit here rather than on :root because automatic.css loads AFTER the
   Etch registry and redeclares --link-color on :root, so an equally specific
   rule loses on order. ":root > body" outranks it and stops the fix depending
   on enqueue order. */
--link-color: var(--primary-dark);
--link-color-hover: var(--primary-ultra-dark);
}
.lt-scheme {
  & .lt-seg__btn[aria-pressed="true"] {
	color: var(--primary-ultra-light);
	background: var(--primary-semi-dark);
}
}
.lt-cards {
  display: grid;
gap: var(--space-s);
}
.lt-lesson-section {
  .lt-lesson-section__inner {
	display: grid;
	max-inline-size: var(--width-60);
}
}
.lt-phrase {
  display: grid;
gap: var(--space-xs);
padding: var(--space-s);
background: var(--bg-ultra-light);
border: 1px solid var(--base-light);
border-radius: var(--radius);

/* Layer 1, Thai script. Carries --primary because on this site the brand colour
   IS the colour of the language being taught. */
.lt-phrase__script {
	--lt-thai-size: var(--text-xl);
	margin: 0;
	font-weight: 600;
	color: var(--primary-semi-dark);
}

/* Layer 2, transliteration. Tone diacritics are load-bearing, so 600 keeps them
   legible, and it is never letter-spaced. */
.lt-phrase__translit {
	margin: 0;
	font-weight: 600;
	color: var(--text-dark-muted);
}

.lt-phrase__meaning { margin: 0; color: var(--text-dark); }

.lt-phrase__note {
	margin: 0;
	font-size: var(--text-s);
	color: var(--text-dark-muted);
}

/* A sentence ending ครับ or ค่ะ is not gender-neutral, so the speaker is stated. */
.lt-phrase__speaker {
	margin: 0;
	font-size: var(--text-s);
	font-weight: 600;
	color: var(--primary-semi-dark);
}

/* Unfilled fields collapse rather than rendering an empty row. */
.lt-phrase__script:empty,
.lt-phrase__translit:empty,
.lt-phrase__meaning:empty,
.lt-phrase__note:empty,
.lt-phrase__speaker:empty { display: none; }

.lt-phrase__audio {
	display: grid;
	gap: var(--space-xs);

	& audio {
		inline-size: 100%;
		max-inline-size: var(--width-30);
		display: block;
	}

	/* Audio trust tiers, each honestly labelled. Only native-verified renders
	   with no notice at all. */
	&[data-lt-audio="placeholder"]::after,
	&[data-lt-audio="unverified"]::after {
		padding: var(--space-xs);
		font-size: var(--text-s);
		font-weight: 600;
		color: var(--warning-dark);
		background: var(--warning-ultra-light);
		border-radius: var(--radius);
	}

	&[data-lt-audio="placeholder"]::after {
		content: "Placeholder tone, not speech. Awaiting a native-speaker recording.";
	}

	&[data-lt-audio="unverified"]::after {
		content: "Computer voice, not yet checked by a native speaker.";
	}
}

/* The female realisation, on the same card. Indented under a subtle rule rather
   than boxed: a nested card inside a card is banned by the doctrine, and the
   point is that this is the SAME utterance, differently realised. */
.lt-phrase__variant {
	display: grid;
	gap: var(--space-xs);
	margin-block-start: var(--space-xs);
	padding-block-start: var(--space-s);
	border-block-start: 1px dashed var(--base-light);

	& .lt-phrase__script {
		--lt-thai-size: var(--text-l);
	}
}
}
[data-lt-translit] {
  &[data-lt-translit="never"] [data-lt-layer="translit"] { display: none; }

&[data-lt-translit="tap"] [data-lt-layer="translit"]:not(.is-revealed) {
	/* Masked, not removed, so screen readers and copy-paste still get the text. */
	color: transparent;
	background: var(--base-light);
	border-radius: var(--radius);
	cursor: pointer;
	user-select: none;
	transition: background var(--transition-duration) ease-out;

	&:hover,
	&:focus-visible { background: var(--base-semi-light); }
}
}
.lt-chips {
  display: flex;
flex-wrap: wrap;
gap: var(--space-xs);
margin: 0;
padding: 0;
list-style: none;

& a {
	display: inline-flex;
	align-items: center;
	min-block-size: 44px;
	padding-inline: var(--space-s);
	font-size: var(--text-s);
	font-weight: 600;
	color: var(--primary-semi-dark);
	background: var(--bg-ultra-light);
	border: 1px solid var(--base-light);
	border-radius: var(--radius);
	text-decoration: none;
	transition: border-color var(--transition-duration) ease-out;

	&:hover { border-color: var(--primary-semi-dark); }
}
}
:where([data-etch-element="container"]) {
  inline-size: 100%;
  display: flex;
  flex-direction: column;
  max-inline-size: var(--content-width, 1366px);
  align-self: center; margin-inline: auto;
}
:where([data-etch-element="flex-div"]) {
  inline-size: 100%;
  display: flex;
  flex-direction: column;
}
:root {
  /* PAGE SURFACE. Nothing was painting the page at all, so it sat on the browser's
   default canvas. In light mode that looks fine and hides the bug; in dark mode
   the headings correctly flipped to near-white through their light-dark() token
   while the canvas stayed white, putting the h1 at a measured 1.05:1 against its
   background. Invisible, on every page of the site.

   It lives on :root rather than on body because Etch keeps its own system style
   for the body selector and silently drops a second registry entry claiming it.
   The root element's background paints the canvas regardless, and this token
   inverts in step with the text tokens. It also removes the pure white the
   design rules forbid: the token is an off-white tinted to the brand hue. */
background-color: var(--bg-ultra-light);
color: var(--bg-ultra-light-text);

/* Looped cut (มีหัว): the loop is a primary letter-identifying feature, so the
   loopless cut is measurably harder for someone acquiring the script. */
--lt-thai-font: "IBM Plex Sans Thai Looped", "Noto Sans Thai", sans-serif;
/* Thai stacks vowels AND tone marks above and below the baseline; Latin leading
   collides them. */
--lt-thai-leading: 1.95;
/* Applied to a whole mixed-script paragraph, 1.95 reads as double-spaced. */
--lt-thai-leading-mixed: 1.8;
/* Thai needs ~10-15% more optical size than Latin: its tone marks are small and
   the mark IS the word. */
--lt-thai-optical: 1.12;
}
:where([data-etch-element="iframe"]) {
  inline-size: 100%;
  height: auto;
 aspect-ratio: 16/9;
}
:where([data-etch-element="section"]) {
  inline-size: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.lt-close {
  /* Bookends the hero, so it carries the same scheme-stable brand surface. */
--_close-bg: oklch(0.30 0.048 190);
--_close-ink: oklch(0.97 0.006 190);
--_close-ink-muted: oklch(0.86 0.014 190);

background: var(--_close-bg);
color: var(--_close-ink);

.lt-close__inner { text-align: center; }

.lt-close__title {
	color: var(--_close-ink);
	text-wrap: balance;
	margin-block: 0 var(--space-s);
}

.lt-close__lede {
	font-size: var(--text-l);
	color: var(--_close-ink-muted);
	max-inline-size: 54ch;
	margin-inline: auto;
	margin-block: 0 var(--space-m);
}

.lt-close__actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-s);
	justify-content: center;
}

& .btn {
	--btn-background: var(--_close-ink);
	--btn-text-color: var(--_close-bg);
	--btn-border-color: var(--_close-ink);
	--btn-background-hover: var(--_close-ink-muted);
	--btn-text-color-hover: var(--_close-bg);
	--btn-border-color-hover: var(--_close-ink-muted);
}

/* Two classes, to outrank ACSS's own .btn--primary-light.btn--outline. */
& .btn.btn--outline {
	--btn-background: transparent;
	--btn-text-color: var(--_close-ink);
	--btn-border-color: var(--_close-ink);
	--btn-background-hover: var(--_close-ink);
	--btn-text-color-hover: var(--_close-bg);
}

.lt-close__honest {
	margin-block: var(--space-l) 0;
	font-size: var(--text-s);
	color: var(--_close-ink-muted);
	max-inline-size: 62ch;
	margin-inline: auto;

	& a { color: var(--_close-ink); }
}
}
:is(p, li, td, dd, h1, h2, h3, h4, h5, h6):has([lang="th"]) {
  /* Thai inline in English prose would otherwise make that ONE line tall while its
   neighbours keep Latin leading, giving a visibly jagged paragraph. Bump the
   whole block and let the inline Thai inherit it. */
line-height: var(--lt-thai-leading-mixed);

& [lang="th"] { line-height: inherit; }
}
.lt-dish {
  display: grid;
/* minmax(0, 1fr), as on .lt-lesson: a grid item defaults to min-width:auto, so a
   wide .lt-table with nowrap cells pushed this column past the phone's edge and
   the whole page scrolled sideways. */
grid-template-columns: minmax(0, 1fr);
gap: var(--content-gap);

.lt-dish__title { margin: 0; }

.lt-dish__media {
	margin: 0;
	display: grid;
	gap: var(--space-xs);

	& img {
		inline-size: 100%;
		max-inline-size: 100%;
		block-size: auto;
		border-radius: var(--radius);
	}

	/* No photo: collapse rather than show a broken image and empty caption. */
	&:has(img[src=""]) { display: none; }
}

.lt-dish__credit {
	font-size: var(--text-xs);
	color: var(--text-dark-muted);

	& a { color: var(--text-dark-muted); }
}

.lt-dish__body p { margin: 0; white-space: pre-line; }

/* The name broken into its parts. It sits between the name and the photo, so it
   is boxed to read as apparatus rather than as more prose. ACSS tokens only. */
.lt-dish__name {
	padding: var(--space-s);
	border: 1px solid var(--base-light);
	border-radius: var(--radius);
	font-size: var(--text-s);

	/* A dish with no breakdown collapses rather than showing an empty box. */
	&:empty { display: none; }

	& > :first-child { margin-block-start: 0; }
	& > :last-child { margin-block-end: 0; }
}

.lt-dish__facts {
	display: grid;
	gap: var(--space-xs);
	padding: var(--space-s);
	background: var(--bg-ultra-light);
	border: 1px solid var(--base-light);
	border-radius: var(--radius);
}

.lt-dish__fact {
	margin: 0;
	font-size: var(--text-s);

	& .lt-lesson__label { display: block; }
}

.lt-dish__spice {
	font-weight: 600;
	text-transform: capitalize;

	&[data-spice="hot"],
	&[data-spice="very-hot"] { color: var(--danger-dark); }
	&[data-spice="medium"] { color: var(--warning-dark); }
}
}
.lt-seg {
  display: flex;
align-items: center;
gap: var(--space-xs);
flex-wrap: wrap;

.lt-seg__label {
	font-size: var(--text-xs);
	font-weight: 600;
	color: var(--text-dark-muted);
}

.lt-seg__set {
	display: flex;
	padding: 2px;
	background: var(--bg-light);
	border-radius: var(--radius);
}

.lt-seg__btn {
	/* 44px tap target: these are the two most-used controls on the site and the
	   audience is on a phone. */
	display: inline-flex;
	align-items: center;
	min-block-size: 44px;
	padding-inline: var(--space-xs);
	font: inherit;
	font-size: var(--text-xs);
	font-weight: 600;
	color: var(--text-dark-muted);
	background: none;
	border: 0;
	border-radius: var(--radius);
	cursor: pointer;
	transition: background var(--transition-duration) ease-out,
		color var(--transition-duration) ease-out;

	&:hover { color: var(--text-dark); }

	/* The accent earns its place here: the transliteration toggle is the
	   signature control, and one of only two places accent is allowed. */
	&[aria-pressed="true"] {
		color: var(--accent-ultra-light);
		background: var(--accent-semi-dark);
	}
}
}
[lang="th"] {
  font-family: var(--lt-thai-font);
line-height: var(--lt-thai-leading);
/* Components set --lt-thai-size (an ACSS type token) rather than font-size, so
   the optical bump is applied in one place and never fights on specificity. */
font-size: calc(var(--lt-thai-size, 1em) * var(--lt-thai-optical));

/* STRUCTURAL GUARD, not a style choice: uppercase-transform and letter-spacing
   both detach tone marks from their base consonant. */
text-transform: none !important;
letter-spacing: normal !important;
font-variant-caps: normal !important;

/* The optical bump must not compound when Thai nests inside Thai. */
& [lang="th"] { font-size: 1em; }
}
.lt-index {
  /* Rows, not a grid of identical tiles: the doctrine bans repeated icon-and-
   heading card grids, and a scannable list reads faster at this size. */
display: grid;
gap: var(--space-xs);
margin: 0;
padding: 0;
list-style: none;

& li {
	display: grid;
	gap: 2px;
	padding-block: var(--space-xs);
	border-block-end: 1px solid var(--base-light);

	&:last-child { border-block-end: 0; }
}

& a {
	font-weight: 600;
	/* These are the primary navigation on every hub, so the whole row is the
	   target rather than the 23px text box. */
	display: block;
	padding-block: 8px;
}

.lt-index__note,
.lt-index__count {
	font-size: var(--text-s);
	color: var(--text-dark-muted);
}
}
.lt-header {
  display: flex;
align-items: center;
justify-content: space-between;
gap: var(--space-s);
flex-wrap: wrap;
inline-size: 100%;
padding-block: var(--space-s);
padding-inline: var(--gutter);
background: var(--bg-ultra-light);
border-block-end: 1px solid var(--base-light);

.lt-header__brand {
	font-family: var(--heading-font-family);
	font-size: var(--h4);
	font-weight: 600;
	color: var(--text-dark);
	text-decoration: none;
	/* 44px tap target. The audience is phone-first, and the rendered height was
	   23px, below the 24px WCAG 2.5.8 floor let alone a comfortable target. */
	display: inline-flex;
	align-items: center;
	min-block-size: 44px;
}

/* MOBILE HEADER. Four flex children wrapping freely made the bar 339px tall on a
   390px phone: 40% of the viewport, with the h1 pushed to 422px, entirely below
   the fold. Someone opening the site on their phone saw brand, eight nav links,
   a toggle and a search box, and no content whatsoever.
   
   Grid instead of wrap, so the rows are chosen rather than accidental: identity
   and the reading toggle share the top row, search gets its own full-width row
   because it is the primary action for someone who needs one phrase right now,
   and the nav becomes a single scrolling strip instead of three stacked rows. */
@media (width < 40rem) {
	display: grid;
	grid-template-columns: auto 1fr;
	grid-template-areas:
		"brand  seg"
		"search search"
		"nav    nav";
	align-items: center;
	gap: var(--space-xs);
	padding-block: var(--space-xs);

	.lt-header__brand { grid-area: brand; }

	& > .lt-search { grid-area: search; }

	& > .lt-seg {
		grid-area: seg;
		justify-self: end;
		flex-wrap: nowrap;
	}

	/* Hidden visually, NOT with display:none: the group's accessible name comes
	   from this element via aria-labelledby, and removing it from the tree would
	   leave the control announced as an unnamed group. */
	& > .lt-seg .lt-seg__label {
		position: absolute;
		inline-size: 1px;
		block-size: 1px;
		overflow: hidden;
		clip-path: inset(50%);
		white-space: nowrap;
	}

	& > .lt-nav {
		grid-area: nav;
		flex-wrap: nowrap;
		overflow-x: auto;
		overscroll-behavior-x: contain;
		scrollbar-width: none;
		/* Bleed to the screen edges so the strip visibly runs off the side and
		   reads as scrollable, while the first link still lines up with the
		   brand above it. */
		margin-inline: calc(var(--gutter) * -1);
		padding-inline: var(--gutter);

		&::-webkit-scrollbar { display: none; }
		& a { flex: 0 0 auto; }
	}
}
}
.lt-hero {
  /* Scheme-stable on purpose, for the same reason as the scrim over the
   photographs further down the page: this is a brand surface, and an ACSS
   light-dark() token would inverted it into a pale mint band in dark mode,
   which fights the page instead of anchoring it. Locally-scoped custom
   properties rather than invented token names, tinted to the brand hue 190 and
   never pure white.

   Measured against --_hero-bg: ink 15.9:1, muted 9.6:1, kicker 7.4:1. */
--_hero-bg: oklch(0.30 0.048 190);
--_hero-ink: oklch(0.97 0.006 190);
--_hero-ink-muted: oklch(0.86 0.014 190);
--_hero-kicker: oklch(0.80 0.058 190);

background: var(--_hero-bg);
color: var(--_hero-ink);

.lt-hero__inner {
	display: grid;
	gap: var(--space-l);
	align-items: center;
}

.lt-hero__eyebrow {
	font-size: var(--text-s);
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--_hero-kicker);
	margin-block: 0 var(--space-xs);
}

.lt-hero__title {
	color: var(--_hero-ink);
	text-wrap: balance;
	margin-block: 0 var(--space-s);
}

.lt-hero__lede {
	font-size: var(--text-l);
	color: var(--_hero-ink-muted);
	/* A lede is scanned, not read: well under the 65-75ch body cap. */
	max-inline-size: 46ch;
	margin-block: 0 var(--space-m);
}

.lt-hero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-s);
	margin-block-end: var(--space-m);
}

.lt-hero__note {
	font-size: var(--text-s);
	color: var(--_hero-ink-muted);
	margin-block: 0;
}

/* The live phrase sits on a genuine surface change rather than a blurred glass
   panel: it is the product, so it should read as solid and legible. */
.lt-hero__demo {
	background: var(--bg-ultra-light);
	color: var(--bg-ultra-light-text);
	border-radius: var(--radius);
	padding: var(--space-m);
}

.lt-hero__demo-label {
	font-size: var(--text-xs);
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	/* --primary is one lightness in both schemes and measures 3.43:1 on the
	   dark panel. --primary-dark is a light-dark() pair and clears 4.5:1 either
	   way. */
	color: var(--primary-dark);
	margin-block: 0 var(--space-xs);
}

/* The band no longer inverts, so the buttons must not either. Driving ACSS's
   own button variables keeps the component's padding, radius and typography and
   changes only what has to change. */
& .btn {
	--btn-background: var(--_hero-ink);
	--btn-text-color: var(--_hero-bg);
	--btn-border-color: var(--_hero-ink);
	--btn-background-hover: var(--_hero-kicker);
	--btn-text-color-hover: var(--_hero-bg);
	--btn-border-color-hover: var(--_hero-kicker);
}

/* Two class names, not one: ACSS's own .btn--primary-light.btn--outline rule is
   also two classes, and it loads after the registry, so a single-class override
   ties on specificity and loses on order. That left the outline button's label
   at a measured 1.08:1 in dark mode. */
& .btn.btn--outline {
	--btn-background: transparent;
	--btn-text-color: var(--_hero-ink);
	--btn-border-color: var(--_hero-ink);
	--btn-background-hover: var(--_hero-ink);
	--btn-text-color-hover: var(--_hero-bg);
}

/* The phrase card is already styled globally; inside the hero panel it only
   needs its outer chrome removed so it does not read as a card in a card. */
& .lt-phrase {
	border: 0;
	padding: 0;
	background: none;
	margin-block: 0;
}

@media (width >= 60rem) {
	.lt-hero__inner {
		grid-template-columns: var(--grid-3-2);
		gap: var(--space-xl);
	}
}
}
.lt-nav {
  display: flex;
gap: var(--space-s);
flex-wrap: wrap;
align-items: center;

& a {
	font-size: var(--text-s);
	font-weight: 600;
	color: var(--text-dark);
	text-decoration: none;
	/* min-block-size rather than padding, so the underline stays on the text
	   while the tap target reaches 44px. */
	display: inline-flex;
	align-items: center;
	min-block-size: 44px;
	border-block-end: 2px solid transparent;
	transition: border-color var(--transition-duration) ease-out,
		color var(--transition-duration) ease-out;

	&:hover,
	&[aria-current="page"] {
		color: var(--primary-semi-dark);
		border-block-end-color: var(--primary-semi-dark);
	}
}
}
.lt-finder {
  display: grid;
gap: var(--space-s);
padding: var(--space-m);
background: var(--primary-ultra-light);
border-radius: var(--radius);

.lt-finder__label {
	font-weight: 600;
	margin-block: 0;
}

.lt-finder__input {
	inline-size: 100%;
	padding: var(--space-s);
	font: inherit;
	font-size: var(--text-l);
	color: var(--text-dark);
	background: var(--bg-ultra-light);
	border: 1px solid var(--base-semi-light);
	border-radius: var(--radius);

	&:focus-visible {
		outline: 2px solid var(--primary);
		outline-offset: 1px;
	}
}

.lt-finder__hint {
	font-size: var(--text-s);
	color: var(--text-dark-muted);
	margin-block: 0;
}

.lt-finder__results {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: var(--space-xs);
}

.lt-finder__hit {
	display: grid;
	gap: var(--space-xs);
	padding: var(--space-s);
	background: var(--bg-ultra-light);
	border-radius: var(--radius);

	& a {
		text-decoration: none;
		display: grid;
		gap: 2px;
	}
	& audio {
		inline-size: 100%;
		block-size: 36px;
	}
}

.lt-finder__th {
	--lt-thai-size: var(--text-xl);
	font-weight: 600;
	color: var(--text-dark);
}

.lt-finder__tr {
	color: var(--text-color);
}

.lt-finder__m {
	color: var(--text-dark);
}

.lt-finder__none {
	color: var(--text-dark-muted);
	margin-block: 0;
}
}
.lt-translit {
  display: flex;
align-items: center;
gap: var(--space-xs);
flex-wrap: wrap;

.lt-translit__label {
	font-size: var(--text-xs);
	font-weight: 600;
	color: var(--text-dark-muted);
}

.lt-translit__set {
	display: flex;
	padding: 2px;
	background: var(--bg-light);
	border-radius: var(--radius);
}

.lt-translit__btn {
	padding-block: 2px;
	padding-inline: var(--space-xs);
	font: inherit;
	font-size: var(--text-xs);
	font-weight: 600;
	color: var(--text-dark-muted);
	background: none;
	border: 0;
	border-radius: var(--radius);
	cursor: pointer;
	transition: background var(--transition-duration) ease-out,
		color var(--transition-duration) ease-out;

	&:hover { color: var(--text-dark); }

	/* The accent earns its place here: this is the signature control, and one of
	   only two places accent is allowed to appear. */
	&[aria-pressed="true"] {
		color: var(--accent-ultra-light);
		background: var(--accent-semi-dark);
	}
}
}
.lt-paths {
  .lt-paths__grid {
	display: grid;
	gap: var(--space-s);
	margin-block-start: var(--space-l);
}

.lt-paths__lead {
	display: block;
	padding: var(--space-l);
	border-radius: var(--radius);
	background: var(--primary-ultra-light);
	color: var(--primary-ultra-light-text, var(--text-dark));
	text-decoration: none;

	&:hover { background: var(--primary-light); }
}

/* These three are spans inside an anchor, so they are inline by default and
   would otherwise run together on one line. */
.lt-paths__lead-kicker {
	display: block;
	font-size: var(--text-xs);
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--primary-semi-dark);
	margin-block: 0 var(--space-xs);
}

.lt-paths__lead-title {
	display: block;
	font-size: var(--h4);
	font-family: var(--heading-font-family);
	font-weight: 600;
	line-height: var(--base-heading-lh);
	margin-block: 0 var(--space-xs);
}

.lt-paths__lead-note {
	display: block;
	color: var(--text-color);
	max-inline-size: 58ch;
	margin-block: 0;
}

.lt-paths__item {
	display: block;
	padding-block: var(--space-s);
	border-block-start: 1px solid var(--base-light);
	text-decoration: none;

	&:hover .lt-paths__title { text-decoration: underline; }
}

.lt-paths__title {
	font-weight: 600;
	color: var(--primary-semi-dark);
	display: block;
}

.lt-paths__note {
	color: var(--text-color);
	font-size: var(--text-s);
	display: block;
	max-inline-size: 46ch;
}

@media (width >= 48rem) {
	.lt-paths__grid { grid-template-columns: var(--grid-2); column-gap: var(--space-xl); }
	.lt-paths__lead { grid-column: 1 / -1; }
}
}
.lt-hub {
  /* Layout lives on the CONTAINER, not the section: the section has exactly one
   child (the Etch container), so a gap on the section would do nothing and the
   real content would not be laid out at all. */
.lt-hub__inner {
	display: grid;
	/* Same reason as .lt-lesson: without an explicit minmax(0, ...) track, a wide
	   table or card inside refuses to shrink and pushes the page sideways. */
	grid-template-columns: minmax(0, 1fr);
	gap: var(--content-gap);
	/* The Etch container defaults to --content-width (1366px), which is far too
	   wide for reading. */
	max-inline-size: var(--width-60);

	& > :is(h1, h2) { margin: 0; }
	& > p { margin: 0; max-inline-size: 68ch; }
}

.lt-hub__lede {
	font-size: var(--text-l);
	color: var(--text-dark-muted);
}

/* Sits under a stage heading on a situation page and explains what that group of
   cards is for. Pulled tight to its heading so the two read as one unit rather
   than as a heading followed by an unrelated sentence. */
.lt-hub__stage-note {
	margin-block-start: calc(var(--content-gap) * -0.6);
	color: var(--text-dark-muted);
	font-size: var(--text-s);
}

/* Jump list for the long situation pages. Sits directly under the lede, so it
   reads as a contents list rather than as navigation. */
.lt-hub__jump {
	padding-block-end: var(--space-s);
	border-block-end: 1px solid var(--base-light);

	& .lt-index__count {
		color: var(--text-dark-muted);
		font-variant-numeric: tabular-nums;
	}
}

.lt-hub__onward {
	padding-block-start: var(--space-s);
	border-block-start: 1px solid var(--base-light);
	font-size: var(--text-s);
	color: var(--text-dark-muted);
}
}
.lt-tastes {
  /* A photograph does not change with the colour scheme, so its scrim must not
   either: a light-dark() token would flip to a pale wash in dark mode and
   strand the label on a bright plate. Deliberately scheme-stable, and tinted to
   the brand hue rather than being neutral black. */
--_scrim: oklch(0.18 0.03 190);
--_scrim-text: oklch(0.97 0.005 190);

/* Intro prose, held to the readable measure. The grid below is deliberately
   full container width; the paragraph above it is not. */
& > .lt-tastes__inner > p { max-inline-size: 68ch; }

.lt-tastes__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
	gap: var(--space-s);
	margin-block-start: var(--space-l);
}

.lt-tastes__item {
	position: relative;
	display: block;
	overflow: hidden;
	border-radius: var(--radius);
	text-decoration: none;
	aspect-ratio: 1;
	background: var(--base-light);

	/* One plate anchors the band so it reads as a composition rather than a
	   contact sheet of equal tiles. */
	&:first-child {
		grid-column: span 2;
		aspect-ratio: 2;
	}

	&:focus-visible {
		outline: 2px solid var(--primary);
		outline-offset: 3px;
	}
}

.lt-tastes__img {
	inline-size: 100%;
	block-size: 100%;
	object-fit: cover;
	display: block;
	/* Scale, not width/height: never animate layout properties. */
	transition: scale var(--transition-duration) cubic-bezier(0.22, 1, 0.36, 1);
}

.lt-tastes__item:is(:hover, :focus-visible) .lt-tastes__img { scale: 1.05; }

.lt-tastes__label {
	position: absolute;
	inset-inline: 0;
	inset-block-end: 0;
	padding: var(--space-s);
	/* The scrim has to stay near-opaque across the whole area the text occupies,
	   not just at the very bottom: the photograph behind it is arbitrary and a
	   pale plate would otherwise strand the label. It only fades in the top
	   fifth, above the text. */
	background: linear-gradient(
		to top,
		color-mix(in oklch, var(--_scrim) 96%, transparent) 0%,
		color-mix(in oklch, var(--_scrim) 90%, transparent) 78%,
		transparent 100%
	);
	color: var(--_scrim-text);
}

.lt-tastes__th {
	--lt-thai-size: var(--text-xl);
	font-weight: 600;
	display: block;
}

.lt-tastes__translit {
	font-size: var(--text-s);
	opacity: 0.85;
	display: block;
}

@media (prefers-reduced-motion: reduce) {
	.lt-tastes__img { transition: none; }
	.lt-tastes__item:is(:hover, :focus-visible) .lt-tastes__img { scale: 1; }
}
}
.lt-footer {
  display: grid;
gap: var(--space-xs);
inline-size: 100%;
padding-block: var(--space-l);
padding-inline: var(--gutter);
margin-block-start: var(--space-l);
background: var(--bg-ultra-light);
border-block-start: 1px solid var(--base-light);
font-size: var(--text-s);
color: var(--text-dark-muted);

& a { color: var(--primary-semi-dark); }
}
.lt-search {
  /* The header search form. On WordPress this had to be a core wp:search block
   (raw-html kses dropped form and input), so the CSS targeted core's class names.
   Studio renders form/input/button as element blocks, so the markup is the
   site's own and the classes are BEM like every other block here. */
display: flex;
align-items: center;
gap: var(--space-xs);
margin: 0;

.lt-search__label {
	position: absolute;
	inline-size: 1px;
	block-size: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.lt-search__field {
	display: flex;
	align-items: center;
	gap: var(--space-xs);
	min-inline-size: 0;
}

.lt-search__input {
	min-inline-size: 0;
	inline-size: clamp(9rem, 18vw, 15rem);
	padding: var(--space-xs) var(--space-s);
	font-size: var(--text-s);
	color: var(--bg-ultra-light-text);
	background: var(--bg-ultra-light);
	border: 1px solid var(--base-light);
	border-radius: var(--radius);
	/* 44px tap target: this is a phone-first audience reaching for it one-handed
	   in a market. */
	min-block-size: 44px;

	&::placeholder { color: var(--text-dark-muted); }

	&:focus-visible {
		outline: 2px solid var(--primary-dark);
		outline-offset: 1px;
	}
}

.lt-search__button {
	min-block-size: 44px;
	margin: 0;
	padding-inline: var(--space-s);
	font-size: var(--text-s);
	font-weight: 600;
	color: var(--bg-ultra-light);
	background: var(--primary-dark);
	border: 0;
	border-radius: var(--radius);
	cursor: pointer;

	&:hover { background: var(--primary-ultra-dark); }
	&:focus-visible { outline: 2px solid var(--primary-dark); outline-offset: 2px; }
}

/* On a narrow screen the header already wraps; let the field take the row
   rather than squeezing next to the toggle. */
@media (width < 40rem) {
	inline-size: 100%;
	.lt-search__field { inline-size: 100%; }
	.lt-search__input { inline-size: 100%; }
}
}
.lt-lesson {
  display: grid;
/* minmax(0, 1fr), not the implicit 1fr. A grid item defaults to min-width:auto,
   so it refuses to shrink below its content's intrinsic width; a wide table with
   nowrap cells therefore pushed this whole column out to 2,066px on a 390px
   phone. The table's own overflow-x:auto never engaged, because it was the
   CONTAINER that grew rather than the table being constrained. This one track
   definition is what lets the table scroll inside itself instead. */
grid-template-columns: minmax(0, 1fr);
gap: var(--content-gap);

.lt-lesson__title { margin: 0; }

/* Textarea fields keep their authored line breaks. */
.lt-lesson__body,
.lt-lesson__goal p,
.lt-lesson__watch p { white-space: pre-line; }

/* Hold the prose to a readable measure. The lessons grew from about 1,300 bytes
   to about 11,000, and at that length a full-container line is genuinely hard to
   track back to the start of the next one. Tables and letter grids are NOT
   capped: they need the width, and they are scanned rather than read.

   ch rather than a fixed rem, because the measure that matters is characters per
   line, and this text mixes Latin with Thai at a larger optical size. */
.lt-lesson__body { max-inline-size: 72ch; }
.lt-lesson__goal,
.lt-lesson__watch { max-inline-size: 78ch; }

.lt-lesson__goal,
.lt-lesson__watch {
	display: grid;
	gap: var(--space-xs);
	padding: var(--space-s);
	border-radius: var(--radius);
}

.lt-lesson__goal { background: var(--primary-ultra-light); }
.lt-lesson__watch { background: var(--warning-ultra-light); }

.lt-lesson__label {
	margin: 0;
	font-size: var(--text-xs);
	font-weight: 600;
	color: var(--text-dark-muted);
}

.lt-lesson__goal p:last-child,
.lt-lesson__watch p:last-child,
.lt-lesson__body p:last-child { margin-block-end: 0; }

/* A block whose only content is an unpopulated field renders nothing. */
.lt-lesson__goal:has(.lt-lesson__val:empty),
.lt-lesson__watch:has(.lt-lesson__val:empty),
.lt-lesson__body:has(.lt-lesson__val:empty) { display: none; }

.lt-lesson__next {
	margin: 0;
	padding-block-start: var(--space-s);
	border-block-start: 1px solid var(--base-light);
	font-weight: 600;

	/* A lesson with no next step renders nothing, not a link to nowhere. */
	&:has(a:empty) { display: none; }
}
}
.lt-layers {
  /* Width of the label column. A one-off measure with no matching ACSS token, so
   it is a locally-scoped property rather than an invented token name. */
--_tag-col: 8.5rem;

.lt-layers__lede {
	font-size: var(--text-l);
	max-inline-size: 62ch;
	margin-block-end: var(--space-l);
}

.lt-layers__row {
	display: grid;
	gap: var(--space-xs);
	padding-block: var(--space-s);
	border-block-start: 1px solid var(--base-light);

	&:last-of-type { border-block-end: 1px solid var(--base-light); }
}

.lt-layers__tag {
	font-size: var(--text-xs);
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	/* --primary-dark, not --primary: see the note on the demo label. */
	color: var(--primary-dark);
	margin-block: 0;
}

.lt-layers__value {
	/* Each layer is deliberately set differently: the whole point is that these
	   are three separate things, and identical styling would undercut the claim. */
	margin-block: 0;

	&[data-layer="script"] { --lt-thai-size: var(--h3); font-weight: 600; }
	&[data-layer="sound"]  { font-size: var(--text-xl); color: var(--text-color); }
	&[data-layer="sense"]  { font-size: var(--text-l); }
}

.lt-layers__why {
	color: var(--text-color);
	margin-block: var(--space-xs) 0;
	max-inline-size: 62ch;
}

@media (width >= 48rem) {
	.lt-layers__row {
		grid-template-columns: var(--_tag-col) 1fr;
		gap: var(--space-xs) var(--space-m);
		align-items: baseline;
	}
	.lt-layers__tag { grid-row: span 2; }
}
}