.vocabulary-hint { color: var(--coffee); line-height: 1.65; max-width: 48rem; }
.vocabulary-search { margin: 1.5rem 0; }
.vocabulary-search label { display: block; font-weight: 600; margin-bottom: .5rem; }
.vocabulary-search > div { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: .6rem; }
.vocabulary-search input { min-width: 0; flex: 1; border: 1px solid var(--border-strong); border-radius: var(--radius-md); padding: .8rem; background: var(--paper); color: var(--ink); }
.vocabulary-entry h3, .vocabulary-popup h3 { margin: 0; overflow-wrap: anywhere; }
.vocabulary-entry .row { gap: 1rem; align-items: start; }
.vocabulary-translation { font-size: 1.15rem; margin: .65rem 0 1rem; overflow-wrap: anywhere; }
.vocabulary-context { color: var(--coffee); line-height: 1.65; font-size: .9rem; overflow-wrap: anywhere; margin: .5rem 0; }
.vocabulary-context strong { color: var(--ink); font-weight: 700; }
.vocabulary-source { border-left: 2px solid var(--sand); padding-left: .9rem; margin: 1rem 0; }
.vocabulary-source-link { border: 0; padding: .2rem 0; background: none; color: var(--slate-blue); text-align: left; font-size: .85rem; cursor: pointer; }
.vocabulary-actions, .vocabulary-pages { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.vocabulary-actions button, .vocabulary-pages button, .vocabulary-dictionary-link { color: var(--ink); background: var(--paper); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: .7rem .9rem; cursor: pointer; }
.vocabulary-dictionary { margin-top: 1rem; }
.vocabulary-dictionary-link { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; font-size: .9rem; text-decoration: none; }
.vocabulary-dictionary-link:hover { background: var(--sand); }
.vocabulary-dictionary-link:focus-visible { outline: 2px solid var(--marigold); outline-offset: 3px; }
.vocabulary-actions button:last-child { margin-left: auto; color: var(--coffee); }
.vocabulary-entry.is-known .pill { color: var(--success-ink); background: var(--success-bg); }
.vocabulary-popup { position: fixed; z-index: 100; right: max(1rem, env(safe-area-inset-right)); bottom: max(1rem, env(safe-area-inset-bottom)); width: min(25rem, calc(100vw - 2rem)); max-height: min(70dvh, 36rem); overflow-y: auto; padding: 1.25rem; border: 1px solid var(--border-strong); border-radius: var(--radius-xl); background: var(--paper); box-shadow: var(--shadow-lg); }
.vocabulary-popup__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .8rem; }
.vocabulary-popup__head button { width: 2.5rem; height: 2.5rem; flex: 0 0 auto; font-size: 1.125rem; background: transparent; border: 1px solid var(--border); color: var(--ink); border-radius: 50%; cursor: pointer; }
.vocabulary-popup .meta:empty { display: none; }
.vocabulary-trigger { position: fixed; z-index: 99; bottom: max(1rem, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); box-shadow: var(--shadow-lg); }
.vocabulary-trigger:hover { transform: translate(-50%, -2px); }
.vocabulary-trigger[hidden], .vocabulary-search[hidden] { display: none; }
.vocabulary-source-target { outline: 2px solid var(--marigold); outline-offset: 4px; }
@media (max-width: 520px) {
  .vocabulary-search > div { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vocabulary-search input { grid-column: 1 / -1; }
  .vocabulary-search button { min-width: 0; width: 100%; }
}
.vocabulary-pronunciation { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; color: #68594c; }
.vocabulary-pronunciation span { font-family: system-ui, sans-serif; }
.vocabulary-speech { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 6px; border: 1px solid #d7c8b6; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; }
.vocabulary-speech .icon { font-size: 20px; }
.vocabulary-speech[aria-pressed="true"] { background: #ffb52c; color: #211b16; }
.vocabulary-speech:focus-visible { outline: 2px solid #af6700; outline-offset: 3px; }
.vocabulary-definition { margin: 0 0 18px; line-height: 1.55; }

/* Проверка слов: интервальное повторение. */
.vocabulary-review { margin: 1.25rem 0; }
.vocabulary-review[hidden] { display: none; }
.vocabulary-review h3 { margin: 0 0 .5rem; }
.vocabulary-review__summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.vocabulary-review__summary > div { flex: 1 1 16rem; min-width: 0; }
.vocabulary-review__summary p { margin: 0 0 .35rem; line-height: 1.55; }
.vocabulary-review__summary.is-due { border-color: var(--marigold); }
.vocabulary-review__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .6rem; margin-top: 1rem; }
.vocabulary-review__summary .vocabulary-review__actions { margin-top: 0; }
.vocabulary-task { display: grid; gap: 1rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.vocabulary-task > li { display: grid; gap: .5rem; min-width: 0; }
.vocabulary-task label { display: grid; gap: .25rem; }
.vocabulary-task input[type="text"] { width: 100%; min-width: 0; min-height: 44px; border: 1px solid var(--border-strong); border-radius: var(--radius-md); padding: .6rem .8rem; background: var(--paper); color: var(--ink); font: inherit; }
.vocabulary-task fieldset { display: grid; gap: .4rem; margin: 0; padding: 0; border: 0; min-width: 0; }
.vocabulary-task legend { padding: 0 0 .25rem; font-weight: 700; overflow-wrap: anywhere; }
.vocabulary-cue { margin: 0; line-height: 1.5; overflow-wrap: anywhere; }
.vocabulary-spell-hint { color: var(--coffee); font-family: Consolas, ui-monospace, monospace; letter-spacing: .12em; }
.vocabulary-option { grid-template-columns: auto 1fr; align-items: start; column-gap: .6rem; min-height: 44px; border: 1px solid var(--border); border-radius: var(--radius-md); padding: .6rem .8rem; cursor: pointer; }
/* Выбор и подсветка слова — в цвете акцента темы: жёлтый «предупреждения» в тёмных темах давал коричневый. */
.vocabulary-option:has(input:checked) { border-color: var(--ember-ink); background: color-mix(in srgb, var(--honey) 45%, var(--paper)); }
.vocabulary-option input { margin: .25rem 0 0; accent-color: var(--ember-ink); }
.vocabulary-option span { overflow-wrap: anywhere; line-height: 1.45; }
.vocabulary-results { display: grid; gap: .75rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.vocabulary-result { border-left: 3px solid var(--border-strong); padding-left: .9rem; }
.vocabulary-result.is-passed { border-left-color: var(--success); }
.vocabulary-result.is-failed { border-left-color: var(--error); }
.vocabulary-result p { margin: .3rem 0 0; }
.vocabulary-marks { display: flex; flex-wrap: wrap; gap: .4rem .9rem; font-size: var(--text-sm); }
.vocabulary-mark { display: inline-flex; align-items: center; gap: .3rem; }
.vocabulary-mark .icon { width: 1rem; height: 1rem; }
.vocabulary-mark.is-right { color: var(--success-ink); }
.vocabulary-mark.is-wrong { color: var(--error-ink); }
.vocabulary-stage { display: inline-flex; gap: 3px; margin-right: .5rem; vertical-align: middle; }
.vocabulary-stage i { width: 9px; height: 9px; border: 1px solid var(--border-strong); border-radius: 50%; }
.vocabulary-stage i.is-on { border-color: var(--success); background: var(--success); }
.vocabulary-entry__review { margin: .4rem 0 .6rem; }
.vocabulary-task label, .vocabulary-task legend { font-size: var(--text-md); }
.vocabulary-task .vocabulary-cue { font-size: 1.05rem; font-weight: 500; }
.vocabulary-option span { font-size: var(--text-md); font-weight: 500; }
.vocabulary-task legend.vocabulary-sentence { font-weight: 500; font-size: 1.05rem; line-height: 1.5; }
.vocabulary-task span.vocabulary-sentence { display: block; font-size: 1.05rem; font-weight: 500; line-height: 1.5; }
.vocabulary-task-caption { display: block; margin-bottom: .3rem; color: var(--coffee); font-size: var(--text-xs); font-weight: 600; }
.vocabulary-task legend .vocabulary-speech { margin-top: .2rem; }
.vocabulary-sentence strong { padding: 0 .15em; border-radius: 3px; background: color-mix(in srgb, var(--honey) 55%, var(--paper)); font-weight: 700; }
.vocabulary-flashcard { display: grid; align-content: center; justify-items: center; gap: .6rem; width: 100%; min-height: 13rem; margin-top: 1rem; padding: 1.5rem 1.25rem; border: 1px solid var(--border-strong); border-radius: var(--radius-lg, var(--radius-md)); color: var(--ink); background: var(--paper); font: inherit; text-align: center; cursor: pointer; animation: vocabulary-flip .28s ease-out; }
.vocabulary-flashcard.is-flipped { border-color: var(--marigold); animation-name: vocabulary-flip-back; }
.vocabulary-flashcard__label { color: var(--coffee); font-size: var(--text-xs); font-weight: 600; }
.vocabulary-flashcard__text { font-size: 1.5rem; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.vocabulary-flashcard__meaning { font-size: var(--text-md); line-height: 1.5; overflow-wrap: anywhere; }
.vocabulary-flashcard .vocabulary-context { max-width: 36rem; margin: 0; }
@keyframes vocabulary-flip { from { transform: rotateX(-80deg); opacity: .2; } to { transform: none; opacity: 1; } }
@keyframes vocabulary-flip-back { from { transform: rotateX(80deg); opacity: .2; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .vocabulary-flashcard { animation: none; } }
.vocabulary.is-reviewing > :is(.vocabulary-hint, .vocabulary-search, [data-vocab-summary], [data-vocab-list], .vocabulary-pages) { display: none; }
