/*
 * Lingo's front-end screens, on the dk1 block families.
 *
 * Every card, button, badge, field, notice, list and table on these screens
 * is family markup (Lingo_Wp_UI, inc/custom/ui.php) painted by the family's
 * own stylesheet. What is left here is only what the families do not model:
 * the app's grids and rails, the review card's recall row, the practice
 * transcript's bubbles, the dark appearance setting. Every rule is
 * parent-qualified to at least (0,2,1) because the theme paints form
 * controls at (0,1,1) after the block sheets and bare headings at (0,1,1)
 * inside its appearance scopes, and states every property it means to
 * change. Colours and radii come from the --wpds-* tokens the shell defines.
 */

/* ---- shared seams ------------------------------------------------------- */

.lingo-note {
	color: var(--wpds-color-foreground-content-neutral-weak, #707070);
}

/* The blocks toggle visibility with the hidden attribute; an author display
   value must not win over it. */
.wp-block-lingo-wp-stage-track [hidden],
.wp-block-lingo-wp-review-queue [hidden],
.wp-block-lingo-wp-scenario-list [hidden],
.wp-block-lingo-wp-vocabulary-list [hidden],
.lingo-sidebar-language [hidden],
.lingo-entry-detail [hidden] {
	display: none !important;
}

.lingo-form { display: flex; flex-direction: column; gap: var(--wpds-dimension-gap-md, 12px); }
.lingo-form .lingo-form-row { display: flex; gap: var(--wpds-dimension-gap-sm, 10px); align-items: flex-end; flex-wrap: wrap; }
.lingo-form .lingo-form-row > div.wpds-field { flex: 1 1 180px; }
.lingo-form .lingo-form-row > .wpds-toggle { flex: 0 0 auto; }
.lingo-form .lingo-spacer,
.lingo-review-row .lingo-spacer,
.lingo-suggestions-head .lingo-spacer { flex: 1 1 auto; }
.lingo-form div.wpds-field { inline-size: 100%; }
.lingo-form div.wpds-field .wpds-field__control { inline-size: 100%; box-sizing: border-box; }
.lingo-form div.wpds-field .wpds-field__control:disabled { background: var(--wpds-color-background-surface-neutral-weak, #f4f4f4); color: var(--wpds-color-foreground-content-neutral-weak, #707070); cursor: not-allowed; }

/* A destructive verb on the neutral outline button: the family has no danger tone. */
.wp-block-lingo-wp-review-queue button.wpds-button.lingo-danger,
.lingo-entry-detail button.wpds-button.lingo-danger {
	border-color: var(--wpds-color-stroke-alert-error, #cc1818);
	color: var(--wpds-color-foreground-content-error-weak, #cc1818);
}

.lingo-toast {
	position: fixed;
	inset-block-end: 24px;
	inset-inline-start: 50%;
	transform: translateX(-50%);
	background: var(--wpds-color-background-interactive-neutral-strong, #1e1e1e);
	color: var(--wpds-color-foreground-interactive-neutral-strong, #ffffff);
	border-radius: var(--wpds-border-radius-lg, 8px);
	padding: 10px 18px;
	font-size: var(--wpds-typography-font-size-md, 13px);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
	z-index: 100;
}

/* ---- overview ------------------------------------------------------------ */

.lingo-hero {
	background: var(--wpds-color-background-surface-neutral-weak, #f4f4f4);
	border-radius: var(--wpds-border-radius-lg, 8px);
	padding: var(--wpds-dimension-padding-2xl, 32px) var(--wpds-dimension-padding-xl, 28px);
}
.lingo-hero h2 {
	font-size: clamp(28px, 4vw, 40px);
	line-height: 1.1;
	margin: 6px 0 12px;
}
.lingo-hero p { max-width: 56ch; }
.lingo-hero .wp-block-buttons { margin-block-start: 16px; }
.lingo-eyebrow {
	color: var(--wpds-color-foreground-content-neutral-weak, #707070);
	font-size: var(--wpds-typography-font-size-xs, 11px);
	font-weight: var(--wpds-typography-font-weight-emphasis, 600);
	letter-spacing: 0.4px;
	text-transform: uppercase;
	margin: 0 0 4px;
}

.wp-block-lingo-wp-review-count .wpds-notice a.lingo-review-count__link {
	color: inherit;
	font-weight: var(--wpds-typography-font-weight-emphasis, 600);
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* The journey strip's titles are links into the stages; the badge sits under the promise. */
.lingo-stage-cards .wpds-custom-flow-strip__title a { color: inherit; text-decoration: none; }
.lingo-stage-cards .wpds-custom-flow-strip__title a:hover,
.lingo-stage-cards .wpds-custom-flow-strip__title a:focus-visible { text-decoration: underline; }
.lingo-stage-cards .wpds-custom-flow-strip__step span.wpds-badge { margin-block-start: 12px; }

.lingo-stat-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: var(--wpds-dimension-gap-md, 12px);
}
.lingo-stat-grid a.lingo-stat { display: block; color: inherit; text-decoration: none; }
.lingo-stat-grid a.lingo-stat section.wpds-card { block-size: 100%; box-sizing: border-box; }
.lingo-stat-grid a.lingo-stat:hover section.wpds-card,
.lingo-stat-grid a.lingo-stat:focus-visible section.wpds-card { border-color: var(--wpds-color-stroke-surface-brand-strong, #3858e9); }
.lingo-stat-grid a.lingo-stat.is-current section.wpds-card { border-color: var(--wpds-color-stroke-surface-brand-strong, #3858e9); box-shadow: 0 0 0 1px var(--wpds-color-stroke-surface-brand-strong, #3858e9); }
.lingo-stat-grid a.lingo-stat p.wpds-card__title { font-size: var(--wpds-typography-font-size-xl, 20px); }
.lingo-stat-grid a.lingo-stat p.wpds-card__title .lingo-stat__unit { font-size: var(--wpds-typography-font-size-md, 13px); font-weight: var(--wpds-typography-font-weight-regular, 400); color: var(--wpds-color-foreground-content-neutral-weak, #707070); }

/* ---- sidebar ------------------------------------------------------------- */

.wpds-app-sidebar .wpds-sidebar-header__identity-row { align-items: center; gap: var(--wpds-dimension-gap-sm, 8px); }
.wpds-app-sidebar .wpds-sidebar-header .wp-block-site-logo { flex: 0 0 auto; }
.wpds-app-sidebar .wpds-sidebar-header .wp-block-site-title { margin: 0; }

/* The language switcher is one wpds/dropdown-menu; only its live state is ours. */
.lingo-sidebar-language .lingo-sidebar-language__trigger {
	inline-size: 100%;
	display: flex;
	align-items: center;
	gap: var(--wpds-dimension-gap-sm, 8px);
	text-align: start;
}
.lingo-sidebar-language .lingo-sidebar-language__copy { display: flex; flex-direction: column; min-inline-size: 0; flex: 1 1 auto; }
.lingo-sidebar-language .lingo-sidebar-language__label { font-size: var(--wpds-typography-font-size-xs, 11px); color: var(--wpds-color-foreground-content-neutral-weak, #707070); text-transform: uppercase; letter-spacing: 0.4px; }
.lingo-sidebar-language .lingo-sidebar-language__current { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lingo-sidebar-language .lingo-sidebar-language__surface { position: absolute; inset-inline-start: 0; inset-block-start: calc(100% + 4px); inline-size: 100%; z-index: 30; max-block-size: 360px; overflow: auto; }
.lingo-sidebar-language { position: relative; }
.lingo-sidebar-language .lingo-sidebar-language__search { display: block; padding: 4px; }
.lingo-sidebar-language .lingo-sidebar-language__search input.wpds-field__control { inline-size: 100%; box-sizing: border-box; }
.lingo-sidebar-language .lingo-sidebar-language__option { inline-size: 100%; text-align: start; background: transparent; border: 0; cursor: pointer; font: inherit; color: inherit; }
.lingo-sidebar-language .lingo-sidebar-language__native { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); }
.wpds-js .lingo-sidebar-language .lingo-sidebar-language__native { display: none; }

/* The source sidebar action is a navigation row, not a centred CTA. */
.wpds-app-sidebar .wpds-app-sidebar__action--ask {
	inline-size: 100%;
	justify-content: flex-start;
	position: relative;
	z-index: 1;
	text-align: start;
}

/* Collapsed, the rail is icon-width: the docs row would overflow it. */
@media ( min-width: 783px ) {
	.wpds-sidebar-collapsed .wpds-sidebar-footer nav.wpds-docs-row {
		block-size: 1px;
		clip-path: inset( 50% );
		inline-size: 1px;
		overflow: hidden;
		padding: 0;
		position: absolute;
		white-space: nowrap;
	}
}

/* ---- stage track ----------------------------------------------------------- */

.wp-block-lingo-wp-stage-track { display: grid; gap: var(--wpds-dimension-gap-lg, 16px); padding-block-end: 40px; }
.wp-block-lingo-wp-stage-track article.lingo-stage-card .wpds-custom-lesson-card__placeholder { min-height: 200px; display: grid; place-items: center; }
.wp-block-lingo-wp-stage-track article.lingo-stage-card .wpds-custom-lesson-card__meta { display: flex; align-items: center; flex-wrap: wrap; gap: var(--wpds-dimension-gap-sm, 8px); }

/* A collapsed icon rail has no useful width for text-only disclosures. */
@media (min-width: 783px) {
	.wpds-sidebar-collapsed details.wpds-sidebar-disclosure { display: none; }
}
.wp-block-lingo-wp-stage-track article.lingo-stage-card .lingo-stage-card__glyph { font-size: clamp(64px, 10vw, 120px); font-weight: 700; letter-spacing: -0.04em; color: var(--wpds-color-foreground-content-brand, #3858e9); opacity: 0.35; }
.wp-block-lingo-wp-stage-track section.lingo-guidance h4 { margin-block: 12px 4px; }
.wp-block-lingo-wp-stage-track section.lingo-guidance ul { margin-block-start: 4px; }
.wp-block-lingo-wp-stage-track .lingo-focus-presets { display: flex; gap: 6px; flex-wrap: wrap; }
.wp-block-lingo-wp-stage-track .lingo-focus-presets button.wpds-button.is-active { background: var(--wpds-color-background-interactive-brand-weak, #eef0ff); border-color: var(--wpds-color-stroke-surface-brand-strong, #3858e9); color: var(--wpds-color-foreground-interactive-brand, #3858e9); }
.wp-block-lingo-wp-stage-track .lingo-stage-suggestions:not(:empty) { margin-block-start: 12px; }
.wp-block-lingo-wp-stage-track .lingo-suggestions-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-block-end: 8px; }
.wp-block-lingo-wp-stage-track .lingo-own-entries { display: grid; gap: 8px; margin-block-start: 12px; }
.wp-block-lingo-wp-stage-track .lingo-source-links { display: block; font-size: var(--wpds-typography-font-size-xs, 11px); margin-block-start: 3px; }
.wp-block-lingo-wp-stage-track .lingo-stage-verification { display: inline-flex; gap: 4px; flex-wrap: wrap; margin-inline-start: 6px; }

.wp-block-lingo-wp-stage-track .lingo-track {
	display: grid;
	grid-template-columns: minmax(200px, 260px) minmax(0, 1fr);
	gap: var(--wpds-dimension-gap-lg, 16px);
	align-items: start;
}
@media (max-width: 860px) {
	.wp-block-lingo-wp-stage-track .lingo-track { grid-template-columns: 1fr; }
}
.wp-block-lingo-wp-stage-track .lingo-rail { display: grid; gap: 10px; position: sticky; inset-block-start: 12px; }
.wp-block-lingo-wp-stage-track .lingo-track-meter { display: grid; gap: 2px; }
.wp-block-lingo-wp-stage-track .lingo-rail button.wpds-item--action {
	display: grid;
	grid-template-columns: 24px minmax(0, 1fr) auto;
	align-items: center;
	gap: 8px;
	inline-size: 100%;
	text-align: start;
}
.wp-block-lingo-wp-stage-track .lingo-rail .lingo-rail__item.is-current button.wpds-item--action { background: var(--wpds-color-background-surface-neutral-weak, #f4f4f4); font-weight: var(--wpds-typography-font-weight-emphasis, 600); }
.wp-block-lingo-wp-stage-track .lingo-rail .lingo-mark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	inline-size: 22px;
	block-size: 22px;
	border-radius: 50%;
	border: 1px solid var(--wpds-color-stroke-surface-neutral, #ccc);
	font-size: var(--wpds-typography-font-size-xs, 11px);
	font-variant-numeric: tabular-nums;
}
.wp-block-lingo-wp-stage-track .lingo-rail .lingo-rail__item.is-done .lingo-mark { background: var(--wpds-color-background-interactive-brand-strong, #3858e9); border-color: var(--wpds-color-stroke-surface-brand-strong, #3858e9); color: var(--wpds-color-foreground-interactive-brand-strong, #fff); }
.wp-block-lingo-wp-stage-track .lingo-rail .lingo-rail-name { min-inline-size: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wp-block-lingo-wp-stage-track .lingo-rail .lingo-rail-tally { color: var(--wpds-color-foreground-content-neutral-weak, #707070); font-variant-numeric: tabular-nums; font-size: var(--wpds-typography-font-size-sm, 12px); }
.wp-block-lingo-wp-stage-track section.lingo-panel p.wpds-card__title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wp-block-lingo-wp-stage-track section.lingo-panel .lingo-panel__name:focus { outline: none; }
.wp-block-lingo-wp-stage-track .lingo-track-foot { display: flex; gap: 10px; margin-block-start: 16px; flex-wrap: wrap; align-items: center; }

/* Chunk rows: the data view's list layout, with the app's Hear and Keep controls in the lanes the family leaves. */
.lingo-chunks .wpds-data-view__primary { display: flex; align-items: center; gap: 8px; min-inline-size: 0; }
.lingo-chunks li.wpds-data-view__list-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.lingo-chunks .wpds-data-view__list-actions { display: inline-flex; gap: 4px; justify-self: end; }
@media (max-width: 640px) {
	.lingo-chunks li.wpds-data-view__list-row { grid-template-columns: 1fr; }
	.lingo-chunks .wpds-data-view__list-actions { justify-self: start; }
}

/* ---- review ---------------------------------------------------------------- */

.wp-block-lingo-wp-review-queue { display: grid; gap: var(--wpds-dimension-gap-md, 12px); max-width: 720px; }
.wp-block-lingo-wp-review-queue h2.lingo-review-heading { margin: 0; }
.wp-block-lingo-wp-review-queue section.lingo-review-card .lingo-front { font-size: clamp(22px, 3vw, 30px); font-weight: var(--wpds-typography-font-weight-emphasis, 600); margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wp-block-lingo-wp-review-queue .lingo-review-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.wp-block-lingo-wp-review-queue .lingo-review-row div.wpds-field.lingo-recall__field { flex: 1 1 220px; }
.wp-block-lingo-wp-review-queue .lingo-review-row div.wpds-field .wpds-field__control { inline-size: 100%; box-sizing: border-box; }
.wp-block-lingo-wp-review-queue .lingo-review-row__buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.wp-block-lingo-wp-review-queue .lingo-review-back { border-block-start: 1px solid var(--wpds-color-stroke-surface-neutral-weak, #f0f0f0); margin-block-start: 8px; padding-block-start: 16px; display: grid; gap: 12px; }
.wp-block-lingo-wp-review-queue .lingo-review-back .lingo-back-text { font-size: var(--wpds-typography-font-size-lg, 15px); font-weight: var(--wpds-typography-font-weight-emphasis, 600); margin: 0; }
.wp-block-lingo-wp-review-queue .lingo-review-back p { margin: 0; }

/* ---- vocabulary ------------------------------------------------------------ */

.wp-block-lingo-wp-vocabulary-list .lingo-vocab-view .wpds-data-view__primary { display: flex; align-items: center; gap: 6px; }
.wp-block-lingo-wp-vocabulary-list .lingo-vocab-tags { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.wp-block-lingo-wp-vocabulary-list .lingo-vocab-actions { display: inline-flex; gap: 2px; white-space: nowrap; }
.wp-block-lingo-wp-vocabulary-list dialog.lingo-vocab-dialog {
	border: 1px solid var(--wpds-color-stroke-surface-neutral-weak, #ddd);
	border-radius: var(--wpds-border-radius-lg, 8px);
	padding: var(--wpds-dimension-padding-xl, 24px);
	color: inherit;
	background: var(--wpds-color-background-surface-neutral, #fff);
	box-shadow: 0 16px 60px rgba(0, 0, 0, 0.24);
	inline-size: min(520px, 90vw);
}
.wp-block-lingo-wp-vocabulary-list dialog.lingo-vocab-dialog::backdrop { background: rgba(0, 0, 0, 0.4); }

/* The completions list under the capture field. */
.lingo-form div.wpds-field.lingo-autocomplete { position: relative; }
.lingo-form .lingo-autocomplete__list { position: absolute; z-index: 20; inset-inline: 0; inset-block-start: calc(100% - 20px); list-style: none; margin: 0; padding: 4px; background: var(--wpds-color-background-surface-neutral, #fff); border: 1px solid var(--wpds-color-stroke-surface-neutral, #ccc); border-radius: var(--wpds-border-radius-md, 4px); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14); max-block-size: 260px; overflow: auto; }
.lingo-form .lingo-autocomplete__list li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 8px 10px; cursor: pointer; border-radius: 3px; }
.lingo-form .lingo-autocomplete__list li[aria-selected="true"],
.lingo-form .lingo-autocomplete__list li:hover { background: var(--wpds-color-background-interactive-neutral-weak-active, #eee); }
.lingo-form .lingo-autocomplete__list li span:not(.wpds-badge) { grid-column: 1; }

/* ---- translate ------------------------------------------------------------- */

.wp-block-lingo-wp-translate-tool .lingo-translate__direction { align-items: flex-end; }
.wp-block-lingo-wp-translate-tool .lingo-translate__direction button.lingo-swap { margin-block-end: 2px; }
.wp-block-lingo-wp-translate-tool .lingo-result:not(:empty) { margin-block-start: 16px; display: grid; gap: 10px; }
.wp-block-lingo-wp-translate-tool .lingo-result .lingo-back-text { font-size: var(--wpds-typography-font-size-lg, 15px); font-weight: var(--wpds-typography-font-weight-emphasis, 600); margin: 0; }
.wp-block-lingo-wp-translate-tool .lingo-review-row { display: flex; gap: 8px; flex-wrap: wrap; }
.wp-block-lingo-wp-translate-tool .lingo-translate-structure:not(:empty) { border-block-start: 1px solid var(--wpds-color-stroke-surface-neutral-weak, #eee); padding-block-start: 12px; display: grid; gap: 8px; }
.wp-block-lingo-wp-translate-tool .lingo-translate-structure ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.wp-block-lingo-wp-translate-tool .lingo-translate-structure li { display: grid; grid-template-columns: auto minmax(100px, 1fr) minmax(100px, 1fr); gap: 8px; align-items: baseline; }
.wp-block-lingo-wp-translate-tool .lingo-translate-structure li small { grid-column: 2 / -1; color: var(--wpds-color-foreground-content-neutral-weak, #707070); }

/* ---- Ask Lingo (the page-level chat, when a page places it) ---------------- */

.lingo-chat { max-width: 760px; }
.lingo-chat .lingo-chat__transcript { display: flex; flex-direction: column; gap: 12px; min-block-size: 220px; max-block-size: 520px; overflow-y: auto; }
.lingo-chat .lingo-chat__empty { margin: auto; text-align: center; max-width: 50ch; display: grid; gap: 12px; }
.lingo-chat .lingo-chat__suggestions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.lingo-chat .lingo-chat-message,
.lingo-practice .lingo-chat-message { max-width: 82%; padding: 10px 12px; border-radius: var(--wpds-border-radius-lg, 8px); background: var(--wpds-color-background-surface-neutral-weak, #f4f4f4); }
.lingo-chat .lingo-chat-message.is-user,
.lingo-practice .lingo-chat-message.is-user { align-self: flex-end; background: var(--wpds-color-background-interactive-brand-strong, #3858e9); color: var(--wpds-color-foreground-interactive-brand-strong, #fff); }
.lingo-chat .lingo-chat-message p { margin: 4px 0 0; white-space: pre-wrap; }
.lingo-chat .lingo-chat-message.is-user .lingo-note { color: inherit; opacity: 0.85; }

/* ---- settings (the sections are cards; only the voice rows are ours) ------- */

.wp-block-lingo-wp-settings.lingo-settings { display: grid; gap: var(--wpds-dimension-gap-md, 12px); }
.wp-block-lingo-wp-settings .lingo-settings__badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.wp-block-lingo-wp-settings .lingo-voice-list button.wpds-item--action { display: grid; gap: 2px; inline-size: 100%; text-align: start; }
.wp-block-lingo-wp-settings .lingo-voice-list button.wpds-item--action.is-active { background: var(--wpds-color-background-interactive-brand-weak, #eef0ff); box-shadow: inset 3px 0 0 var(--wpds-color-stroke-surface-brand-strong, #3858e9); }
.wp-block-lingo-wp-settings .lingo-voice-list .lingo-voice-option__name { font-weight: var(--wpds-typography-font-weight-emphasis, 600); }
.wp-block-lingo-wp-settings .lingo-voice-list .lingo-voice-option__note { color: var(--wpds-color-foreground-content-neutral-weak, #5f5f5f); font-size: var(--wpds-typography-font-size-sm, 12px); }
.wp-block-lingo-wp-settings .lingo-settings__voice-prompt { display: grid; gap: 4px; margin-block-start: 8px; }

/* The appearance setting changes the same token layer the families use. */
html[data-lingo-theme="dark"] {
	color-scheme: dark;
	--wpds-color-background-surface-neutral: #1e1e1e;
	--wpds-color-background-surface-neutral-weak: #2c2c2c;
	--wpds-color-background-interactive-neutral-weak-active: #3a3a3a;
	--wpds-color-foreground-content-neutral: #f0f0f0;
	--wpds-color-foreground-content-neutral-weak: #b5b5b5;
	--wpds-color-stroke-surface-neutral: #606060;
	--wpds-color-stroke-surface-neutral-weak: #3f3f3f;
}
html[data-lingo-theme="dark"] body { background: #1e1e1e; color: #f0f0f0; }
@media (prefers-color-scheme: dark) {
	html[data-lingo-theme="system"] {
		color-scheme: dark;
		--wpds-color-background-surface-neutral: #1e1e1e;
		--wpds-color-background-surface-neutral-weak: #2c2c2c;
		--wpds-color-background-interactive-neutral-weak-active: #3a3a3a;
		--wpds-color-foreground-content-neutral: #f0f0f0;
		--wpds-color-foreground-content-neutral-weak: #b5b5b5;
		--wpds-color-stroke-surface-neutral: #606060;
		--wpds-color-stroke-surface-neutral-weak: #3f3f3f;
	}
	html[data-lingo-theme="system"] body { background: #1e1e1e; color: #f0f0f0; }
}

/* ---- the rail's site name (from upstream; the shell renders it as a paragraph) ---- */
	min-block-size: 0;
}

/*
 * The site name in the rail is NOT the page's heading, so it renders as a
 * paragraph (`wp:site-title {"level":0}`) rather than an h1 -- every app page
 * was shipping two or three h1s, one of them the app's own name on every
 * screen. Its type is pinned here because it was riding on the heading
 * element's styling.
 */
.wpds-app-sidebar .wpds-sidebar-header .wp-block-site-title {
	min-block-size: 0;
	padding-block: 0;
	font-size: var( --wpds-typography-font-size-lg, 15px );
	font-weight: var( --wpds-typography-font-weight-emphasis, 600 );
	line-height: var( --wpds-typography-line-height-sm, 20px );
	color: var( --wpds-color-foreground-content-neutral, #1e1e1e );
}


:root {
	/* Three even 2px rounded strokes on a 24 grid. Kept as a token so the
	   data URI appears once and the mask rule stays readable. */
	--lingo-menu-glyph: url( 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round"><path d="M3.5 6.5h17M3.5 12h17M3.5 17.5h17"/></svg>' );
}

/* ---- mobile chrome corrections ------------------------------------------
 *
 * Both correct the SHARED app-shell chrome from Lingo's own sheet rather than
 * by editing the theme or ui-components-blocks, which every ported app uses
 * and which are another lane's to change. If the shell fixes them upstream,
 * deleting this section is the whole rollback.
 */

@media ( max-width: 782px ) {
	/*
	 * The shell gives the mobile header a FIXED 56px block-size with
	 * overflow:hidden, so it is a compact sticky title bar. A page subtitle
	 * does not fit: it starts at 48px and runs to 92px, so it rendered as a
	 * sliver of clipped letter-tops under the title. A compact bar carries
	 * the title alone, as the app this ports from did on a phone.
	 */
	.wpds-admin-page__header .wpds-admin-page__subtitle {
		display: none;
	}

	/*
	 * The drawer opener draws its hamburger from three 16px borders (the
	 * chevron's border-block-start plus a ::before and ::after offset 5px
	 * either way). It reads thin and slightly uneven at this size.
	 *
	 * Replaced with an inline SVG rather than an icon font. Dashicons is a
	 * 20px-grid glyph set and its menu mark is soft at 24px; FontAwesome
	 * would mean a CDN request from a site that is deliberately sealed, or
	 * bundling a whole font for one glyph, plus a second icon vocabulary
	 * beside the dashicons the rest of the chrome uses. An SVG mask costs
	 * nothing, is sharp at any size, and still inherits currentColor, so the
	 * button keeps its hover and focus states.
	 */
	.wpds-sidebar-collapsed aside.wpds-app-sidebar > .wpds-app-sidebar__collapse .wpds-app-sidebar__collapse-chevron {
		background-color: currentColor;
		block-size: 18px;
		border: 0;
		inline-size: 18px;
		-webkit-mask: var( --lingo-menu-glyph ) center / 18px 18px no-repeat;
		mask: var( --lingo-menu-glyph ) center / 18px 18px no-repeat;
		rotate: none;
		translate: none;
	}

	.wpds-sidebar-collapsed aside.wpds-app-sidebar > .wpds-app-sidebar__collapse .wpds-app-sidebar__collapse-chevron::before,
	.wpds-sidebar-collapsed aside.wpds-app-sidebar > .wpds-app-sidebar__collapse .wpds-app-sidebar__collapse-chevron::after {
		content: none;
	}

	/* Touch layouts use the full content width and keep every primary action
	   at least 44px tall. Compact icon actions stay compact. */
	.lingo-hero {
		padding: var(--wpds-dimension-padding-xl, 24px) var(--wpds-dimension-padding-lg, 16px);
	}

	.lingo-form .lingo-form-row {
		align-items: stretch;
		flex-direction: column;
	}

	.lingo-form .lingo-form-row > div.wpds-field {
		flex-basis: auto;
	}

	.lingo-form .lingo-form-row > .wpds-button:not(.lingo-swap):not(.lingo-icon-button),
	.wp-block-lingo-wp-translate-tool .lingo-translate__query > .wpds-button {
		inline-size: 100%;
		justify-content: center;
		min-block-size: 44px;
	}

	.wp-block-lingo-wp-translate-tool .lingo-translate__direction button.lingo-swap {
		align-self: center;
		block-size: 40px;
		inline-size: 40px;
		rotate: 90deg;
	}

	.lingo-practice .lingo-practice-head {
		align-items: flex-start;
		flex-direction: column;
	}

	.lingo-chat .lingo-chat-message,
	.lingo-practice .lingo-chat-message {
		max-width: 100%;
	}

	.lingo-toast {
		box-sizing: border-box;
		inline-size: calc(100vw - 32px);
		inset-block-end: 16px;
		text-align: center;
	}

}

@media ( max-width: 480px ) {
	.wp-block-lingo-wp-stage-track {
		padding-block-end: 24px;
	}

	.wp-block-lingo-wp-stage-track .lingo-rail button.wpds-item--action {
		grid-template-columns: 24px minmax(0, 1fr);
	}

	.wp-block-lingo-wp-stage-track .lingo-rail .lingo-rail-tally {
		grid-column: 2;
	}

	.lingo-chunks .wpds-data-view__primary {
		align-items: flex-start;
	}

	.wp-block-lingo-wp-review-queue .lingo-review-row__buttons,
	.wp-block-lingo-wp-review-queue .lingo-review-row__buttons .wpds-button {
		inline-size: 100%;
	}
}

/* ---- the public face ----------------------------------------------------
 *
 * These pages wear the plain `content-page` template, not the app shell, so
 * they carry their own rhythm rather than inheriting the work column's.
 */
/*
 * THE LANDING PAGE HAS ITS OWN TYPE SCALE, ON PURPOSE. The wpds tokens top out
 * around 15px because they were drawn for admin chrome, where density is the
 * point. A landing page is the opposite job -- one screen has to carry a whole
 * idea to someone who has never heard of it -- so the sizes here are set in rem
 * and the tokens supply colour, radius and spacing. Same system, different room.
 *
 * Surfaces here come from the THEME PALETTE (--wp--preset--color--*), not the
 * wpds-color-background-* set. Two of those resolve to values their names do not
 * suggest -- interactive-brand-weak is literally `#0000`, so the call-to-action
 * panel rendered with no fill at all, and a CSS fallback cannot rescue a custom
 * property that is defined-but-transparent. The palette entries are declared by
 * theme.json, so they are always real colours.
 */

.lingo-lp-hero { padding-block: 8px 0; }
.lingo-lp-hero__title {
	font-size: clamp(2.25rem, 6vw, 3.75rem);
	line-height: 1.03;
	letter-spacing: -0.03em;
	margin-block: 10px 20px;
	text-wrap: balance;
}
.lingo-lp-hero__lede {
	font-size: clamp(1.0625rem, 2vw, 1.25rem);
	line-height: 1.55;
	max-width: 54ch;
	color: var(--wpds-color-foreground-content-neutral, #1e1e1e);
}
.lingo-lp-hero__actions { margin-block-start: 28px; }
.lingo-lp-hero__meta {
	margin-block-start: 16px;
	font-size: var(--wpds-typography-font-size-md, 13px);
	color: var(--wpds-color-foreground-content-neutral-weak, #707070);
}

.lingo-lp-section { margin-block-start: 72px; }
.lingo-lp-section__lede { max-width: 60ch; color: var(--wpds-color-foreground-content-neutral-weak, #707070); }
.lingo-lp-section__note {
	margin-block-start: 16px;
	font-size: var(--wpds-typography-font-size-md, 13px);
	color: var(--wpds-color-foreground-content-neutral-weak, #707070);
	max-width: 60ch;
}

/* The card decks sit closer to the heading that introduces them. */
.lingo-lp-cards { margin-block-start: 28px; }
.lingo-lp-cards--rules { margin-block-start: 72px; }

.lingo-lp-card {
	block-size: 100%;
	box-sizing: border-box;
	padding: 28px;
	background: var(--wp--preset--color--base-strong, #fff);
	border: 1px solid var(--wp--preset--color--stroke, #dbdbdb);
	border-radius: var(--wpds-border-radius-lg, 8px);
}
.lingo-lp-card__num {
	font-size: var(--wpds-typography-font-size-sm, 12px);
	font-weight: var(--wpds-typography-font-weight-emphasis, 600);
	letter-spacing: 0.12em;
	color: var(--wpds-color-foreground-interactive-brand, #3858e9);
	margin: 0 0 8px;
}
.lingo-lp-card__title { font-size: 1.375rem; line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 10px; }
.lingo-lp-card__body { color: var(--wpds-color-foreground-content-neutral-weak, #707070); margin: 0; }

/* A chip is the target word with its English underneath -- the shape the app
   itself uses for a kept entry, so the landing shows the real thing. */
.lingo-lp-chips { gap: 8px; margin-block-start: 20px; }
.lingo-lp-chip {
	margin: 0;
	padding: 8px 12px;
	background: var(--wp--preset--color--base-weak, #f4f4f4);
	border-radius: var(--wpds-border-radius-md, 4px);
	font-size: var(--wpds-typography-font-size-md, 13px);
	color: var(--wpds-color-foreground-content-neutral-weak, #707070);
	line-height: 1.35;
}
.lingo-lp-chip strong {
	display: block;
	font-size: 0.9375rem;
	color: var(--wpds-color-foreground-content-neutral, #1e1e1e);
}

.lingo-lp-grades { gap: 8px; margin-block-start: 24px; }
.lingo-lp-grade {
	margin: 0;
	padding: 8px 18px;
	border-radius: 999px;
	font-size: var(--wpds-typography-font-size-md, 13px);
	font-weight: var(--wpds-typography-font-weight-emphasis, 600);
	border: 1px solid transparent;
}
.lingo-lp-grade--again { background: #f6e6e3; color: #cc1818; border-color: #f0cdc8; }
.lingo-lp-grade--good  { background: #deebfa; color: #006bd7; border-color: #c5dcf5; }
.lingo-lp-grade--easy  { background: #c6f7cd; color: #1e7e34; border-color: #a5e8b0; }

.lingo-lp-langs { gap: 8px; margin-block-start: 24px; }
.lingo-lp-lang {
	margin: 0;
	padding: 6px 14px;
	border: 1px solid var(--wp--preset--color--stroke, #dbdbdb);
	border-radius: 999px;
	font-size: var(--wpds-typography-font-size-md, 13px);
	color: var(--wpds-color-foreground-content-neutral, #1e1e1e);
	background: var(--wp--preset--color--base-strong, #fff);
}

.lingo-lp-cta {
	margin-block-start: 72px;
	padding: 44px 32px;
	text-align: center;
	background: var(--wp--preset--color--brand-surface, #ecf0fa);
	border-radius: var(--wpds-border-radius-lg, 8px);
}
.lingo-lp-cta__title { font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -0.02em; margin: 0 0 10px; }
.lingo-lp-cta__body { max-width: 52ch; margin-inline: auto !important; color: var(--wpds-color-foreground-content-neutral-weak, #707070); }
.lingo-lp-cta .wp-block-buttons { justify-content: center; margin-block-start: 24px; }

/*
 * Undo the centring the layout imposes. WordPress's constrained layout emits
 * `:where(.is-layout-constrained) > :where(...) { margin-left: auto !important }`,
 * which silently centres anything whose max-width is narrower than contentSize
 * -- so every measured column above would drift away from the heading it
 * belongs to. The :where() wrapper gives that rule zero specificity, so only an
 * important declaration of higher specificity can reach it. The CTA opts back
 * in above, because that panel really is centred.
 */
.lingo-lp-hero__lede,
.lingo-lp-section__lede,
.lingo-lp-section__note,
.lingo-signup { margin-inline: 0 !important; }

/* ---- the journal --------------------------------------------------------
 *
 * Each post is a card rather than a run of title-date-excerpt, because a young
 * blog with a handful of entries reads as broken when it is set as a plain
 * list -- there is not enough text for the rhythm to carry it.
 */
/*
 * The journal head is its own alignwide group so its left edge matches the card
 * grid's. It must NOT use .lingo-lp-section__lede: that class kills the auto
 * margins WordPress uses to centre a measured child, which is right inside a
 * measured group and wrong for a direct child of a full-width main -- there it
 * escapes to the outer edge, left of the heading it belongs to.
 */
.lingo-lp-journal-head p {
	max-width: 62ch;
	margin: 10px 0 0;
	color: var(--wpds-color-foreground-content-neutral-weak, #707070);
}

.lingo-lp-posts { margin-block-start: 36px; }
.lingo-lp-posts .wp-block-post-template { gap: 16px; }
.lingo-lp-posts .wp-block-post {
	box-sizing: border-box;
	padding: 28px;
	background: var(--wp--preset--color--base-strong, #fff);
	border: 1px solid var(--wp--preset--color--stroke, #dbdbdb);
	border-radius: var(--wpds-border-radius-lg, 8px);
	transition: border-color 120ms ease;
}
.lingo-lp-posts .wp-block-post:hover { border-color: var(--wp--preset--color--stroke-strong, #8d8d8d); }
.lingo-lp-post__date {
	margin: 0 0 10px;
	font-size: var(--wpds-typography-font-size-sm, 12px);
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--wpds-color-foreground-content-neutral-weak, #707070);
}
.lingo-lp-post__title { font-size: 1.375rem; line-height: 1.22; letter-spacing: -0.01em; margin: 0 0 10px; }
.lingo-lp-post__title a { text-decoration: none; }
.lingo-lp-post__title a:hover { text-decoration: underline; }
.lingo-lp-post__excerpt { margin: 0; color: var(--wpds-color-foreground-content-neutral-weak, #707070); }
.lingo-lp-post__excerpt .wp-block-post-excerpt__more-link {
	display: inline-block;
	margin-block-start: 14px;
	font-size: var(--wpds-typography-font-size-md, 13px);
	font-weight: var(--wpds-typography-font-weight-emphasis, 600);
	color: var(--wpds-color-foreground-interactive-brand, #3858e9);
	text-decoration: none;
}
.lingo-lp-post__excerpt .wp-block-post-excerpt__more-link:hover { text-decoration: underline; }
.lingo-lp-pagination { margin-block-start: 28px; }

/* A single post reads as an article, not as an app screen. */
.lingo-lp-article__date {
	font-size: var(--wpds-typography-font-size-sm, 12px);
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--wpds-color-foreground-content-neutral-weak, #707070);
	margin-block-end: 28px;
}
.lingo-post-back { margin-block-start: 48px; padding-block-start: 24px; border-top: 1px solid var(--wp--preset--color--stroke, #dbdbdb); }
.lingo-post-back a { text-decoration: none; font-weight: var(--wpds-typography-font-weight-emphasis, 600); }
.lingo-post-back a:hover { text-decoration: underline; }

@media (max-width: 781px) {
	.lingo-lp-section, .lingo-lp-cards--rules, .lingo-lp-cta { margin-block-start: 48px; }
	/* Core's grid layout keeps its column count at every width. */
	.lingo-lp-posts .wp-block-post-template.is-layout-grid { grid-template-columns: 1fr; }
	.lingo-lp-card { padding: 22px; }
	.lingo-lp-cta { padding: 32px 22px; }
}

.lingo-signup { max-width: 26rem; }
.lingo-signup__trap { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.lingo-signup-error {
	border: 1px solid #cc1818;
	border-radius: var(--wpds-border-radius-sm, 2px);
	padding: 8px 12px;
	color: #cc1818;
	font-size: var(--wpds-typography-font-size-md, 13px);
}


/* ---- voices, split by language (one wpds/field select + Preview per row) --- */

.wp-block-lingo-wp-settings .lingo-voice-group { display: grid; gap: 4px; }
.wp-block-lingo-wp-settings .lingo-voice-row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) max-content;
	align-items: flex-end;
	gap: var(--wpds-dimension-gap-md, 12px);
	max-width: 36rem;
}
.wp-block-lingo-wp-settings .lingo-voice-row div.wpds-field .wpds-field__control { inline-size: 100%; box-sizing: border-box; }
.wp-block-lingo-wp-settings .lingo-voice-row button.lingo-voice-preview { margin-block-end: 2px; }
.wp-block-lingo-wp-settings section.lingo-voice-diagnostics dl.wpds-meta-table { margin: 0; }
.wp-block-lingo-wp-register .lingo-signup__trap { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); }
