/* Design tokens and shared components for extension pages and the overlay's shadow roots (hence :host).
   Only the panel page switches light/dark via `data-theme`; everything else keeps the first block's dark tokens.
   White over media or a coloured fill is --on-media or --on-accent, the same in both looks. */

@import url("brand.css");

:root,
:host(:not([data-wovia-look="page"])) {
  color-scheme: dark;
  /* The website's ground in its default look: its install manifest's colours and index.html's theme-color (backend/site-app.js). */
  --site-bg: #f2f4f7;
  /* The foreground the faint tints and lines are mixed from: color-mix(in srgb, var(--ink) N%, transparent). */
  --ink: #ffffff;
  --on-accent: #ffffff;
  --on-media: #ffffff;
  /* A darker press on a field, the scroll bars' thumbs, a switch's knob, the inverse surface of toasts. */
  --press: rgba(0, 0, 0, 0.3);
  --scrollbar: #3d3f44;
  --switch-thumb: #e0e0e0;
  --inverse: #323232;
  --on-inverse: #ffffff;
  /* Text on a fill of the learner's word colour (a stage's pill switched on). */
  --on-word: #111111;
  /* A count beside a drawer row, a done message, a saved sentence's mark as text. */
  --nav-count: #41af99;
  --success: #4caf50;
  --saved-text: #ffec8e;
  /* The reference's bright status colours as text, icons and lines (a ready file, a warning, information). */
  --success-bright: #00e676;
  --warning-text: #ffc107;
  --info-text: #00bfff;
  --bg: #1a1c1f;
  --bg-deep: #131517;
  --surface: #23252a;
  --surface-raised: #292c31;
  --surface-soft: rgba(255, 255, 255, 0.04);
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.133);
  --line-soft: rgba(255, 255, 255, 0.1);
  --field-bg: rgba(0, 0, 0, 0.2);
  --field-border: rgba(255, 255, 255, 0.15);
  --text: #e2e5e9;
  --text-strong: #ffffff;
  --text-nav: #cccccc;
  --text-label: rgba(255, 255, 255, 0.667);
  --text-muted: rgba(255, 255, 255, 0.55);
  /* Captions and an unchosen tab's icon (v3 text.tertiary). */
  --text-tertiary: rgba(255, 255, 255, 0.45);
  --text-tool: rgba(255, 255, 255, 0.7);
  /* What the pointer is over and what is chosen: a fill, a field's edge, the chosen item's text. The panel page's
     looks draw them in the brand's blue (owner, 2026-10-14); here the reference's neutral white. */
  --hover: rgba(255, 255, 255, 0.05);
  --selected: rgba(255, 255, 255, 0.08);
  --tab-active: rgba(255, 255, 255, 0.1);
  --hover-line: rgba(255, 255, 255, 0.4);
  --selected-text: #ffffff;
  /* The chosen page's icon and bar in a tab bar (v3: blue 600 on white, blue 300 on navy). */
  --nav-on: var(--wovia-blue-light);
  --pill-bg: rgba(255, 255, 255, 0.06);
  --accent: var(--wovia-blue);
  --accent-hover: var(--wovia-blue-strong);
  --accent-track: color-mix(in srgb, var(--wovia-blue) 50%, transparent);
  --accent-soft: var(--wovia-blue-light);
  --lang: #37ae92;
  --lang-text: #7fd7c2;
  --saved: var(--wovia-yellow);
  /* The save button's heart (icons.js SAVE_ICONS). */
  --heart: var(--wovia-heart);
  --badge-new: #ff9800;
  --chevron: color-mix(in srgb, var(--wovia-blue-pale) 73.3%, transparent);
  --danger: #f28b82;
  --focus: var(--wovia-blue-light);
  --shadow: 0 11px 15px -7px rgba(0, 0, 0, 0.2), 0 24px 38px 3px rgba(0, 0, 0, 0.14), 0 9px 46px 8px rgba(0, 0, 0, 0.12);
  /* v3's elevations (Nền tảng §05): 1 an ordinary card, 2 the main card; --shadow is 3, menus and dialogs. */
  --elevation-1: 0 1px 2px rgba(0, 0, 0, 0.3);
  --elevation-2: 0 10px 28px rgba(0, 0, 0, 0.4);
  /* v3's radii (Nền tảng §05): tags, number boxes and segments, buttons and tiles, cards, main cards and sheets. */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 999px;
  /* v3's motion (Nền tảng §07): a press or a chip, a sheet or a toast, a change of page; one curve within a page. */
  --motion-fast: 120ms;
  --motion-base: 200ms;
  --motion-slow: 280ms;
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --ease-emphasized: cubic-bezier(0.05, 0.7, 0.1, 1);
  --font: "Noto Sans", Helvetica, Arial, sans-serif;
  /* Headings; the panel page's looks write every word in one face (v3), so there it is --font. */
  --font-display: var(--font);
  /* Numbers and scores (v3 type.number, Baloo 2 in the panel page's looks) and Chinese (v3 type.chinese). */
  --font-number: var(--font);
  --font-zh: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", var(--font);
  /* v3's type scale (Nền tảng §04) as font shorthands; nothing a learner reads is under 12 px. */
  --type-display: 700 28px/36px var(--font);
  --type-title: 700 17px/24px var(--font);
  --type-heading: 700 16px/22px var(--font);
  --type-card: 600 15px/20px var(--font);
  --type-body: 500 14px/20px var(--font);
  --type-secondary: 400 13px/18px var(--font);
  --type-caption: 500 12px/16px var(--font);
  --type-button: 600 14px/20px var(--font);
  --type-input: 500 15px/20px var(--font);
  /* A control switched off (v3 text.disabled on grey 100 over a grey 200 lip), the dim behind a dialog or a sheet,
     and the halo round a field being typed in. */
  --text-disabled: rgba(255, 255, 255, 0.35);
  --fill-disabled: rgba(255, 255, 255, 0.08);
  --lip-disabled: rgba(255, 255, 255, 0.06);
  --scrim: rgba(0, 0, 0, 0.5);
  --field-focus-ring: 0 0 0 3px color-mix(in srgb, var(--wovia-blue) 40%, transparent);
  /* Cards and blocks: a card's edge and lip, a button's face over a lip it sinks onto when pressed, the chosen chip's
     soft face and edge; the panel page's looks draw them as v3 does (html[data-theme] below). */
  --edge-px: 2px;
  --card-lip-px: 3px;
  --lip-px: 4px;
  --edge: rgba(255, 255, 255, 0.12);
  --block-lip: var(--wovia-blue-lip);
  --white-block-lip: rgba(255, 255, 255, 0.14);
  --chip: color-mix(in srgb, var(--wovia-blue) 22%, transparent);
  --chip-edge: color-mix(in srgb, var(--wovia-blue) 45%, transparent);
  --chip-text: var(--wovia-blue-light);
  /* The tonal button (v3 action.tonal): the second action on a card. */
  --tonal: color-mix(in srgb, var(--wovia-blue) 22%, transparent);
  --tonal-text: var(--wovia-blue-light);
  /* The three, put together for the stylesheets: a card's edge and lip, a blue block's lip, a white block's. */
  --card-border: var(--edge-px) solid var(--edge);
  --card-shadow: 0 var(--card-lip-px) 0 var(--edge);
  --block-shadow: 0 var(--lip-px) 0 var(--block-lip);
  --white-block-shadow: inset 0 0 0 1px var(--white-block-lip), 0 var(--lip-px) 0 var(--white-block-lip);
  --chip-shadow: inset 0 0 0 var(--edge-px) var(--chip-edge);
  /* Pro's yellow (v3 action.accent): its block button over a lip with grey 900 text, the trial's chip; and a white
     block's edge in the danger's red, the danger button's lip. */
  --pro-block: var(--wovia-yellow);
  --pro-block-text: #101828;
  --pro-block-shadow: 0 var(--lip-px) 0 var(--wovia-yellow-lip);
  /* A yellow tag: Pro's trial, the current item (design system v3 accent.yellow, measured AA on both grounds). */
  --yellow-tag: color-mix(in srgb, var(--wovia-yellow) 16%, transparent);
  --yellow-tag-edge: color-mix(in srgb, var(--wovia-yellow) 45%, transparent);
  --yellow-tag-text: var(--wovia-yellow);
  --pro-chip: var(--yellow-tag);
  --pro-chip-edge: var(--yellow-tag-edge);
  --pro-chip-text: var(--yellow-tag-text);
  --danger-edge: color-mix(in srgb, var(--danger) 35%, transparent);
  --danger-fill: #d92d20;
  --danger-lip: #b42318;
  /* A segmented choice (v3 Thanh chọn): a well with a faint edge, the chosen button raised inside it, one gap all round. */
  --seg-well: var(--pill-bg);
  --seg-well-edge: transparent;
  --seg-gap: 4px;
  --seg-lip-px: 2px;
  --seg-radius: 12px;
  --seg-on: var(--surface-raised);
  --seg-on-shadow: var(--chip-shadow), 0 var(--seg-lip-px) 0 var(--chip-edge);
  --seg-padding: var(--seg-gap) var(--seg-gap) calc(var(--seg-gap) + var(--seg-lip-px));
  /* The current item and "Đang đọc" (v3 accent.yellow): yellow 400 with grey 900 words, in both looks. */
  --current: var(--wovia-yellow);
  --on-current: #101828;
  /* Done and right (v3 status.success): its tint behind a tick, a green tile's fill (white on it 4.7:1), a bar at its end. */
  --success-tint: #0f3b2a;
  --success-fill: #039855;
  --danger-tint: #3d1a1a;
  /* A bar of progress (v3: blue 600 on white, blue 400 on navy). */
  --progress-fill: var(--wovia-blue-400);
}

/* The panel page in either look draws design system v3 (owner, 2026-10-23: canvas "HSK 1–9 và Thi thử", the whole
   web): Be Vietnam Pro for every word, Baloo 2 for numbers, cards on a 1 px edge, buttons on a 3 px lip. */
html[data-theme] {
  --font: "Be Vietnam Pro", "Noto Sans", Helvetica, Arial, sans-serif;
  --font-number: "Baloo 2", var(--font);
  --edge-px: 1px;
  --card-lip-px: 0px;
  --lip-px: 3px;
  --card-shadow: var(--elevation-1);
  --white-block-shadow: inset 0 0 0 1px var(--line-strong), var(--elevation-1);
  --chip-shadow: inset 0 0 0 1px var(--chip-edge);
  --pro-block-shadow: 0 var(--lip-px) 0 var(--wovia-yellow-lip);
  --seg-gap: 3px;
  --seg-lip-px: 0px;
  --seg-radius: 12px;
  --seg-padding: var(--seg-gap);
}

/* The panel page's light look: v3's light tokens (Nền tảng §02), grey 900 text on white cards over grey 100. */
html[data-theme="light"] {
  color-scheme: light;
  --ink: #101828;
  --press: rgba(16, 24, 40, 0.08);
  --scrollbar: #d0d5dd;
  --switch-thumb: #ffffff;
  /* A colour made for the dark (the reference's, the learner's word colours) is drawn no lighter than this OKLCH
     lightness, dark enough on white: `oklch(from <colour> min(l, var(--max-lightness, 1)) c h)` in a stylesheet,
     word-colour-properties.js colourInLook in code. Unset in the dark looks, where the colour is as written. */
  --max-lightness: 0.55;
  --on-word: #ffffff;
  --nav-count: #027a48;
  --success: #027a48;
  --saved-text: var(--wovia-yellow-ink);
  --success-bright: #027a48;
  --warning-text: #b54708;
  --info-text: var(--wovia-blue-strong);
  --bg: var(--site-bg);
  --bg-deep: var(--site-bg);
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --surface-soft: #f9fafb;
  --line: #eaecf0;
  --line-strong: #d0d5dd;
  --line-soft: #f2f4f7;
  --field-bg: #ffffff;
  /* v3 border.input: grey 500, 3:1 and more on white for a field's edge (WCAG 1.4.11). */
  --field-border: #667085;
  --text: #101828;
  --text-strong: #101828;
  --text-nav: #344054;
  --text-label: #344054;
  --text-muted: #475467;
  --text-tertiary: #667085;
  --text-tool: #475467;
  --edge: #eaecf0;
  --white-block-lip: #d0d5dd;
  --chip: var(--wovia-blue-soft);
  --chip-edge: var(--wovia-blue-soft-edge);
  --chip-text: var(--wovia-blue-strong);
  --tonal: var(--wovia-blue-soft);
  --tonal-text: var(--wovia-blue-strong);
  --yellow-tag: var(--wovia-yellow-soft);
  --yellow-tag-edge: var(--wovia-yellow-soft-edge);
  --yellow-tag-text: var(--wovia-yellow-ink);
  --pro-chip: var(--yellow-tag);
  --pro-chip-edge: var(--yellow-tag-edge);
  --pro-chip-text: var(--yellow-tag-text);
  --hover: color-mix(in srgb, var(--wovia-blue) 6%, transparent);
  /* v3: the chosen row of a list is blue 50. */
  --selected: var(--wovia-blue-soft);
  --tab-active: var(--selected);
  --hover-line: color-mix(in srgb, var(--wovia-blue) 70%, transparent);
  --selected-text: var(--wovia-blue-strong);
  --nav-on: var(--wovia-blue);
  --pill-bg: #f2f4f7;
  --accent-track: color-mix(in srgb, var(--wovia-blue) 30%, transparent);
  /* The brand's blue as text and lines on white (v3 text.link, 7.2:1), its fill unchanged. */
  --accent-soft: var(--wovia-blue-strong);
  --lang-text: #0f7a63;
  /* The saved item's gold as a mark on white: the brand's yellow reads 1.6:1 there, step 700 over 4:1. */
  --saved: var(--wovia-yellow-700);
  /* The heart as a mark on white (4.7:1): the brand's reads 3:1 there. */
  --heart: #e11d48;
  --chevron: #98a2b3;
  --danger: #d92d20;
  --danger-edge: #fecdca;
  --focus: var(--wovia-blue);
  --shadow: 0 20px 48px rgba(16, 24, 40, 0.24);
  --elevation-1: 0 1px 2px rgba(16, 24, 40, 0.05);
  --elevation-2: 0 10px 28px rgba(8, 40, 100, 0.18);
  --seg-well: #f2f4f7;
  --seg-well-edge: #eaecf0;
  --seg-on: #ffffff;
  --seg-on-shadow: 0 1px 3px rgba(16, 24, 40, 0.14);
  --text-disabled: #98a2b3;
  --fill-disabled: #f2f4f7;
  --lip-disabled: #eaecf0;
  --scrim: rgba(16, 24, 40, 0.45);
  --field-focus-ring: 0 0 0 4px var(--wovia-blue-100);
  /* A toast: grey 900 with white words, its action in blue 300. */
  --inverse: #101828;
  --on-inverse: #ffffff;
  --success-tint: #d1fadf;
  --danger-tint: #fee4e2;
  --progress-fill: var(--wovia-blue);
}

/* The panel page's dark look: v3's dark tokens (Nền tảng §03), the same names on navy, a card raised by a lighter
   ground rather than a shadow; blue 600 stays the buttons' fill, white on it 5.3:1. */
html[data-theme="dark"] {
  --bg: #0b1220;
  --bg-deep: #0b1220;
  --surface: #151e2e;
  --surface-raised: #1c2739;
  --surface-soft: #151e2e;
  --scrollbar: #2a3548;
  --line: #2a3548;
  --line-strong: #6b7a92;
  --line-soft: #2a3548;
  --field-bg: #0b1220;
  --field-border: #6b7a92;
  --text: #f2f5f9;
  --text-strong: #f2f5f9;
  --text-nav: #b4bfce;
  --text-label: #d0d5dd;
  --text-muted: #b4bfce;
  --text-tertiary: #8a96a8;
  --text-tool: #b4bfce;
  --edge: #2a3548;
  --chip: #13294a;
  --chip-text: var(--wovia-blue-200);
  --tonal: #13294a;
  --tonal-text: var(--wovia-blue-200);
  --hover: color-mix(in srgb, var(--wovia-blue) 18%, transparent);
  --selected: color-mix(in srgb, var(--wovia-blue) 30%, transparent);
  --tab-active: var(--selected);
  --hover-line: var(--wovia-blue-light);
  --selected-text: var(--wovia-blue-light);
  --pill-bg: #1c2739;
  --nav-count: #6ce9a6;
  --success: #6ce9a6;
  --success-bright: #6ce9a6;
  --saved-text: var(--wovia-yellow-300);
  --warning-text: #feb273;
  --info-text: var(--wovia-blue-light);
  --danger: #fda29b;
  --shadow: 0 20px 48px rgba(0, 0, 0, 0.5);
  --elevation-1: none;
  --elevation-2: none;
  --seg-well: #0b1220;
  --seg-well-edge: #2a3548;
  --seg-on: #2a3548;
  --seg-on-shadow: none;
  --text-disabled: #6b7a92;
  --fill-disabled: #1c2739;
  --lip-disabled: #2a3548;
  --scrim: rgba(0, 0, 0, 0.6);
  --inverse: #1c2739;
  --on-inverse: #f2f5f9;
}

/* Base ------------------------------------------------------------------- */

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

html,
body {
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--text);
  font: 400 16px/24px var(--font);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent-soft);
}

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

[hidden] {
  display: none !important;
}

/* A picture drawn for one look (brand.js PRODUCT_LOGOS) shows in that look only; the light one where none is set. */
html:not([data-theme="dark"]) [data-look="dark"],
html[data-theme="dark"] [data-look="light"] {
  display: none !important;
}

::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

::-webkit-scrollbar-thumb {
  border-radius: 5px;
  background: var(--scrollbar);
}

::-webkit-scrollbar-track {
  background: transparent;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.icon {
  display: inline-block;
  flex: none;
}

.language-flag {
  display: inline-block;
  object-fit: contain;
}

.language-flag.is-dimmed {
  filter: grayscale(0.75);
  opacity: 0.48;
}

/* Buttons ---------------------------------------------------------------- */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: var(--on-accent);
  font: 500 16px/24px var(--font);
  cursor: pointer;
  transition: background-color 0.25s;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary.small {
  gap: 6px;
  height: 30px;
  padding: 0 9px;
  font-size: 15px;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--field-border);
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: 500 15px/22px var(--font);
  text-decoration: none;
  cursor: pointer;
}

.btn-outline:hover:not(:disabled) {
  background: var(--hover);
}

.btn-outline:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-outline.is-on {
  border-color: color-mix(in srgb, var(--saved) 45%, transparent);
  color: var(--saved);
}

.tool-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 37px;
  height: 37px;
  margin-left: 2px;
  padding: 5px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-tool);
  cursor: pointer;
}

.tool-button:hover {
  background: var(--hover);
}

.tool-button.bordered {
  width: 36px;
  height: 36px;
  margin: 0 4px;
  border: 1px solid color-mix(in srgb, var(--ink) 20%, transparent);
}

.tool-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 50px;
  background: transparent;
  color: var(--text);
  font: 500 14px/21px var(--font);
  cursor: pointer;
}

.tool-text:hover {
  background: var(--hover);
}

/* Fields ----------------------------------------------------------------- */

.select-wrap {
  position: relative;
  display: inline-flex;
  width: 330px;
  max-width: 100%;
}

.select-field {
  width: 100%;
  height: 40px;
  padding: 0 39px 0 14px;
  border: 1px solid var(--field-border);
  border-radius: 8px;
  background: var(--field-bg);
  color: var(--text-strong);
  font: 400 16px/23px var(--font);
  appearance: none;
  cursor: pointer;
}

.select-field:hover {
  border-color: var(--hover-line);
}

.select-field option {
  background: var(--surface);
  color: var(--text);
}

.select-caret {
  position: absolute;
  top: 50%;
  right: 7px;
  color: var(--text-strong);
  transform: translateY(-50%);
  pointer-events: none;
}

/* combobox.js: a select that filters as one types (the reference's Autocomplete). */
.combo {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.combo-input {
  width: 100%;
  height: 40px;
  padding: 0 39px 0 14px;
  border: 1px solid var(--field-border);
  border-radius: 8px;
  background: var(--field-bg);
  color: var(--text-strong);
  font: 400 16px/23px var(--font);
}

.combo-input:hover {
  border-color: var(--hover-line);
}

.combo-toggle {
  position: absolute;
  top: 50%;
  right: 7px;
  display: flex;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-strong);
  transform: translateY(-50%);
  cursor: pointer;
}

.combo-input[aria-expanded="true"] + .combo-toggle {
  transform: translateY(-50%) rotate(180deg);
}

.combo-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 1300;
  width: 100%;
  max-height: 40vh;
  margin: 0;
  padding: 8px 0;
  overflow: auto;
  border-radius: 4px;
  background: var(--surface);
  box-shadow: 0 5px 5px -3px rgba(0, 0, 0, 0.2), 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12);
  list-style: none;
}

.combo-option {
  display: flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 16px;
  cursor: pointer;
}

.combo-option[aria-selected="true"] {
  background: color-mix(in srgb, var(--wovia-blue-light) 16%, transparent);
}

.combo-option.is-active {
  background: var(--selected);
}

.combo-option[aria-selected="true"].is-active {
  background: color-mix(in srgb, var(--wovia-blue-light) 24%, transparent);
}

.combo-empty {
  padding: 14px 16px;
  color: color-mix(in srgb, var(--ink) 70%, transparent);
}

/* drawer-select.js: a select on a phone or a tablet, the reference's MobileSelect (MobileSelect-9YWUJYf6.js: Ro, jo, Do,
   $o, Lo, Ao, wo, ko, To). */
.drawer-select {
  width: 100%;
}

.drawer-select-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 12px;
  border: 1px solid color-mix(in srgb, var(--ink) 15%, transparent);
  border-radius: 8px;
  background-color: var(--field-bg);
  color: var(--text-strong);
  font: 400 14px/1.4 var(--font);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.drawer-select-button:hover:not(:disabled) {
  border-color: var(--hover-line);
}

.drawer-select-button:focus {
  outline: none;
  border-color: var(--wovia-blue);
}

.drawer-select-button:active:not(:disabled) {
  background-color: var(--press);
}

.drawer-select-button > svg {
  flex-shrink: 0;
  color: color-mix(in srgb, var(--ink) 50%, transparent);
}

.drawer-select-shown {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.drawer-select-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawer-select-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: flex;
  align-items: flex-end;
  background: rgba(0, 0, 0, 0.5);
}

.drawer-select-paper {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: 85dvh;
  padding-bottom: var(--safe-area-bottom, 0px);
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  background: linear-gradient(180deg, var(--surface-raised) 0%, var(--surface) 100%);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.5);
  color: var(--text-strong);
}

.drawer-select-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px 12px;
  border-bottom: 1px solid var(--line);
}

.drawer-select-title {
  font: 600 16px/1.5 var(--font);
  color: var(--text-strong);
}

.drawer-select-close,
.drawer-select-clear {
  display: flex;
  padding: 5px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--text-strong);
  cursor: pointer;
}

.drawer-select-searchbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 16px;
  padding: 0 8px 0 12px;
  border: 1px solid color-mix(in srgb, var(--ink) 23%, transparent);
  border-radius: 4px;
  background-color: var(--field-bg);
}

.drawer-select-magnifier {
  display: flex;
  color: color-mix(in srgb, var(--ink) 50%, transparent);
}

.drawer-select-search {
  flex: 1;
  min-width: 0;
  height: 40px;
  border: 0;
  background: none;
  color: var(--text-strong);
  font: 400 16px/23px var(--font);
  outline: none;
}

.drawer-select-list {
  min-height: 40vh;
  max-height: calc(85dvh - 140px);
  padding: 8px 0;
  overflow-y: auto;
}

.drawer-select-list::-webkit-scrollbar {
  width: 6px;
}

.drawer-select-list::-webkit-scrollbar-thumb {
  border-radius: 3px;
  background-color: var(--scrollbar);
}

.drawer-select-option {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  color: var(--text-strong);
  font: 400 15px/1.5 var(--font);
  cursor: pointer;
}

.drawer-select-option:hover {
  background-color: var(--hover);
}

.drawer-select-option.is-selected {
  background-color: color-mix(in srgb, var(--wovia-blue) 15%, transparent);
  color: var(--wovia-blue);
}

.drawer-select-option.is-selected:hover {
  background-color: color-mix(in srgb, var(--wovia-blue) 25%, transparent);
}

.drawer-select-label {
  flex: 1;
}

.drawer-select-option > svg {
  margin-left: 8px;
  color: var(--wovia-blue);
}

.drawer-select-empty {
  padding: 24px;
  color: color-mix(in srgb, var(--ink) 50%, transparent);
  text-align: center;
}

/* language-options.js: a study language's row (the reference's Settings_basic:L55–90, PhrasePumpDueChip). */
.combo-lang {
  display: flex;
  align-items: center;
  width: 100%;
}

.combo-lang-avatar {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-right: 2px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--field-bg);
  font-size: 18px;
}

.combo-lang-name {
  flex-grow: 1;
  margin-left: 10px;
}

.combo-due-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 20px;
  padding: 0 8px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--ink) 22%, var(--surface));
  font-size: 0.85em;
}

.combo-due-chip.is-due {
  background: var(--wovia-blue);
}

.combo-due-chip svg {
  opacity: 0.8;
}

.text-field {
  width: 100%;
  padding: 14px;
  border: 1px solid var(--field-border);
  border-radius: 8px;
  background: var(--field-bg);
  color: var(--text-strong);
  font: 400 16px/24px var(--font);
  resize: vertical;
}

.text-field::placeholder {
  color: color-mix(in srgb, var(--ink) 40%, transparent);
}

.text-field:hover {
  border-color: var(--hover-line);
}

.text-field[aria-invalid="true"] {
  border-color: var(--danger);
}

.field-error {
  margin: 6px 0 0;
  color: var(--danger);
  font-size: 14px;
}

.field-label {
  display: flex;
  align-items: center;
  margin: 0 0 8px;
  color: var(--text-label);
  font-size: 13px;
  font-weight: 600;
  line-height: 19.5px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.info-icon {
  display: inline-flex;
  margin-left: 8px;
  color: var(--accent);
  letter-spacing: 0;
  text-transform: none;
  cursor: help;
}

.switch {
  display: flex;
  align-items: center;
  min-height: 38px;
  margin: 0 0 10px;
  color: var(--text-strong);
  cursor: pointer;
}

.switch-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-track {
  position: relative;
  flex: none;
  width: 34px;
  height: 14px;
  margin: 0 12px 0 2px;
  border-radius: 7px;
  background: color-mix(in srgb, var(--ink) 30%, transparent);
  transition: background-color 0.15s;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: -3px;
  left: -3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--switch-thumb);
  box-shadow: 0 2px 1px -1px rgba(0, 0, 0, 0.2), 0 1px 1px rgba(0, 0, 0, 0.14), 0 1px 3px rgba(0, 0, 0, 0.12);
  transition: transform 0.15s, background-color 0.15s;
}

.switch-input:checked + .switch-track {
  background: var(--accent-track);
}

.switch-input:checked + .switch-track::after {
  background: var(--accent);
  transform: translateX(20px);
}

.switch-input:focus-visible + .switch-track {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}

/* Pills, badges, headings ----------------------------------------------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 50px;
  background: var(--pill-bg);
  color: var(--text);
  font-size: 13.6px;
  line-height: 20.4px;
}

.pill .icon {
  opacity: 0.7;
}

.section-title {
  display: flex;
  align-items: center;
  margin: 40px 0 24px;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text-strong);
  font-size: 22px;
  font-weight: 600;
  line-height: 33px;
  letter-spacing: 0.3px;
}

/* Gate: the centered "needs something" state ----------------------------- */

/* The extra bottom padding lifts the box to where the reference centres it
   (its box sits 38px above the app-bar-adjusted middle). */
.gate {
  display: flex;
  align-items: center;
  justify-content: center;
  /* the panel's page height (panel.css --page-h: without the bottom bar of a small screen); elsewhere, as before */
  min-height: var(--page-h, calc(100vh - 42px));
  padding: 24px 24px 101px;
  text-align: center;
}

.gate-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 480px;
  padding: 20px;
}

.gate-icon {
  color: var(--text-strong);
  opacity: 0.3;
}

.gate-message {
  margin: 10px 20px 25px;
  color: var(--text-strong);
}

.gate-detail {
  margin: -20px 20px 25px;
  color: var(--text-muted);
  font-size: 15px;
}

.gate-description {
  margin: 28px 0 0;
  color: var(--text-strong);
}

/* Dialog and toasts ------------------------------------------------------ */

.dialog {
  width: min(440px, calc(100vw - 32px));
  padding: 24px;
  border: 0;
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

.dialog::backdrop {
  background: rgba(0, 0, 0, 0.5);
}

.dialog-title {
  margin: 0 0 12px;
  color: var(--text-strong);
  font-size: 20px;
  font-weight: 600;
  line-height: 30px;
}

.dialog p {
  margin: 0 0 10px;
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

.dialog-actions .button {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--field-border);
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: 500 15px/22px var(--font);
  cursor: pointer;
}

.dialog-actions .button:hover {
  background: var(--hover);
}

.dialog-actions .button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}

.dialog-actions .button.danger {
  border-color: #c62828;
  background: #c62828;
  color: var(--on-accent);
}

/* Toasts at the top, centred, below a phone's status bar (owner, 2026-10-23): at the bottom the Windows taskbar hid
   them, and on a phone they sat over the tab bar. */
.toasts {
  position: fixed;
  top: calc(var(--safe-area-top, 0px) + 16px);
  left: 50%;
  z-index: 1400;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: calc(100vw - 32px);
  transform: translateX(-50%);
}

.toast {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 48px;
  padding: 6px 16px;
  border-radius: 4px;
  background: var(--inverse);
  color: var(--on-inverse);
  box-shadow: 0 3px 5px -1px rgba(0, 0, 0, 0.2), 0 6px 10px rgba(0, 0, 0, 0.14), 0 1px 18px rgba(0, 0, 0, 0.12);
  font-size: 14px;
  line-height: 20px;
}

.toast-action {
  padding: 4px 6px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--accent-soft);
  font: 600 14px/20px var(--font);
  cursor: pointer;
}

.toast-action:hover {
  background: color-mix(in srgb, var(--wovia-blue-light) 8%, transparent);
}

/* recording-pill.js: a question being recorded from the toolbar (chatbot.md #101; the reference's $rt, ix:L162862–162940). */
.rec-pill {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 1500;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  border: 1px solid #333;
  border-radius: 30px;
  background: #1e1e1e;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(0, 191, 255, 0.15);
  transform: translate(-50%, -50%);
}

.rec-pill-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #00bfff;
  box-shadow: 0 0 8px #00bfff;
  animation: rec-pill-pulse 1.5s infinite;
}

.rec-pill-label {
  color: #aaa;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.rec-pill-time {
  margin-left: 4px;
  color: #00bfff;
  font: 600 16px "Courier New", monospace;
}

.rec-pill-wait {
  color: #aaa;
}

@keyframes rec-pill-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}

/* notice(): observed on languagereactor.com/help/basic#showSetupComplete=true. */
.notice {
  position: fixed;
  top: 12px;
  right: 16px;
  z-index: 1400;
  width: min(290px, calc(100vw - 32px));
  padding: 12px 40px 14px 12px;
  border-radius: 4px;
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 3px 5px -1px rgba(0, 0, 0, 0.2), 0 6px 10px rgba(0, 0, 0, 0.14), 0 1px 18px rgba(0, 0, 0, 0.12);
}

.notice-title {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
  line-height: 21px;
}

.notice-message {
  margin: 0;
  font-size: 13px;
  line-height: 19px;
}

.notice-close {
  position: absolute;
  top: 6px;
  right: 6px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--on-accent);
  cursor: pointer;
}

.notice-close:hover {
  background: color-mix(in srgb, var(--on-accent) 16%, transparent);
}

/* "Cài đặt mức từ vựng" (vocab-level.js), the reference's modal layout ---- */

.dialog.lr-level-dialog {
  width: min(900px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  background: var(--surface-raised);
}

.lr-level-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px 0 24px;
}

.lr-level-title .dialog-title {
  margin: 0;
}

.lr-level-close {
  border: 0;
  background: none;
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
}

.lr-level-body {
  display: flex;
  height: 530px;
  max-height: calc(100vh - 170px);
  padding: 20px 24px 0;
  font-size: 16px;
  line-height: 1.5;
}

.lr-level-left {
  display: flex;
  flex: 0 0 460px;
  flex-direction: column;
  min-width: 0;
}

.lr-level-left > p {
  margin: 0;
}

.lr-level-words {
  flex-grow: 1;
  margin: 15px 0 0;
  overflow: auto;
  background: var(--field-bg);
}

.lr-level-row {
  position: relative;
  display: flex;
  align-items: center;
  border-bottom: 3px solid color-mix(in srgb, var(--ink) 6%, transparent);
  background: var(--surface);
  cursor: pointer;
}

.lr-level-row.is-hovered {
  background: color-mix(in srgb, var(--ink) 6%, var(--surface));
}

.lr-level-row.is-selected {
  border-bottom: 3px dashed #9cffcd;
}

.lr-level-rank {
  flex: 0 0 44px;
  padding-bottom: 2px;
  font-size: 0.8em;
  text-align: center;
  opacity: 0.3;
}

.lr-level-cells {
  display: flex;
  flex-grow: 1;
  flex-wrap: wrap;
  padding: 3px 15px 6px 6px;
}

.lr-level-word {
  width: 33%;
  font-weight: 400;
  line-height: 1.5;
  text-align: center;
  pointer-events: none;
}

.lr-level-reading {
  display: block;
  font-size: 0.7em;
  opacity: 0.7;
}

.lr-level-start {
  flex-grow: 1;
  padding: 10px;
  text-align: center;
  opacity: 0.6;
}

.lr-level-right {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  min-width: 0;
  padding: 0 0 0 20px;
}

.lr-level-right h4 {
  margin: 0 0 12px;
  text-align: center;
}

.lr-level-example {
  flex-grow: 1;
  overflow: auto;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--ink) 27%, transparent);
  border-radius: 8px;
  font-size: 16px;
  line-height: 1.7;
}

.lr-level-line {
  margin: 0 0 12px;
}

.lr-level-switches {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px 16px 24px 8px;
}

.lr-level-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.lr-level-muted {
  opacity: 0.6;
}

.lr-level-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 12px;
}

.lr-level-actions {
  justify-content: center;
  margin: 0;
  padding: 15px;
}

.lr-level-dialog .field-error {
  margin: 8px 24px 0;
}
