.translated-from-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px;
  background: #eff6ff;
  border-bottom: 1px solid #bfdbfe;
  color: #1e40af;
  font-size: 0.88rem;
  margin: -24px -16px 16px;
}

.translated-from-dismiss {
  background: none;
  border: none;
  color: #1e40af;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6;
  flex-shrink: 0;
  line-height: 1;
  touch-action: manipulation;
}

@media (pointer: coarse) {
  .translated-from-dismiss {
    padding: 0;
    min-width: 44px;
    min-height: 44px;
  }
}

.translated-from-dismiss:hover {
  opacity: 1;
}

body {
  font-family: system-ui, sans-serif;
  margin: 24px auto;
  max-width: 980px;
  padding: 0 16px;
  background: var(--page-bg);
  color: var(--text-body);
}

h1 {
  margin: 0 0 6px 0;
  font-size: 32px;
  line-height: 1.15;
}

h2 {
  margin: 14px 0 8px 0;
  font-size: 22px;
  color: #111827;
}

table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  background: white;
  border: 1px solid var(--card-border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
}

th,
td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--card-border);
}

[dir="rtl"] th,
[dir="rtl"] td {
  text-align: right;
}

th {
  background: var(--page-bg);
  color: #374151;
  font-weight: 700;
}

tr:last-child td {
  border-bottom: none;
}

.conj-form {
  display: flex;
  align-items: center;
  gap: 16px;
}

button {
  padding: 6px 10px;
  cursor: pointer;
}

.btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background-color: #4a90e2;
  color: white;
  font-size: 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  touch-action: manipulation;
}

.btn:hover {
  filter: brightness(0.92);
  transform: scale(1.05);
}

/* .nav-btn and .nav-arrow live in common.css */

.slow-btn {
  width: 48px;
  height: 48px;
  margin-left: 6px;
  padding: 0;
  border: 1px solid #ddd;
  border-radius: 50%;
  background: #f5f5f5;
  color: #333;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  touch-action: manipulation;
}

.slow-btn:hover {
  background: #ececec;
  border-color: #ccc;
  transform: scale(1.05);
}

.slow-btn:active {
  transform: scale(0.97);
}

.slow-icon {
  width: 26px;
  height: 26px;
  display: block;
  filter: brightness(0) invert(0.2);
}

.topbar {
  display: flex;
  flex-direction: column;
  margin-bottom: 16px;
  padding: 14px 18px;
  background: white;
  border: 1px solid var(--card-border);
  border-radius: 16px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
}

/* .topbar-nav, .topbar-nav-right, .topbar-body, .func-panel live in common.css */

/* Inside the learn-page card, the nav row needs no bottom margin — .topbar-body
   provides the gap via padding-top. */
.topbar .topbar-nav {
  margin-bottom: 0;
}

.meta {
  color: #6b7280;
  font-size: 14px;
}


.voice-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.voice-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.voice-gender-icon {
  font-size: 1.15rem;
  line-height: 1;
  margin-right: 3px;
}

[dir="rtl"] .voice-gender-icon {
  margin-right: 0;
  margin-left: 3px;
}

.voice-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 0.9rem;
  font-weight: 700;
}

.voice-icon.female {
  background: #ffe4e6;
  color: #be123c;
}

.voice-icon.male {
  background: #dbeafe;
  color: #1d4ed8;
}

.voice-toggle {
  display: inline-flex;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  overflow: hidden;
  background: #f3f4f6;
}

.voice-btn {
  padding: 8px 14px;
  min-height: 44px;
  border: none;
  background: transparent;
  color: #6b7280;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.12s ease;
}

.voice-btn + .voice-btn {
  border-left: 1px solid var(--card-border);
}

[dir="rtl"] .voice-btn + .voice-btn {
  border-left: none;
  border-right: 1px solid var(--card-border);
}

.voice-btn.active {
  background: #4a90e2;
  color: white;
}

/* ── persona / number filter ─────────────────────────────────────────────── */
.persona-control {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
  margin-bottom: 14px;
  padding: 10px 14px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
}

.filter-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-subtle);
  white-space: nowrap;
}

[dir="rtl"] .filter-label {
  letter-spacing: 0;
  text-transform: none;
}

.persona-toggle,
.number-toggle {
  display: inline-flex;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  overflow: hidden;
  background: var(--button-secondary-bg);
}

.persona-btn,
.number-btn {
  padding: 5px 13px;
  min-height: 44px;
  border: none;
  background: transparent;
  color: var(--text-subtle);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
  touch-action: manipulation;
}

.persona-btn:hover:not(.active),
.number-btn:hover:not(.active) {
  background: var(--card-border);
  color: var(--text-body);
}

.persona-btn + .persona-btn,
.number-btn + .number-btn {
  border-left: 1px solid var(--card-border);
}

.persona-btn.active,
.number-btn.active {
  background: var(--color-navy);
  color: white;
}

.filter-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}


[dir="rtl"] .persona-btn + .persona-btn,
[dir="rtl"] .number-btn + .number-btn {
  border-left: none;
  border-right: 1px solid var(--card-border);
}

/* ── known (star) button ──────────────────────────────────────────────────── */
.func-panel {
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.known-wrap {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.known-caption {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-body);
  line-height: 1;
}

.known-btn {
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid #ddd;
  border-radius: 50%;
  background: #f5f5f5;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
  touch-action: manipulation;
}

.known-btn:hover {
  background: #ececec;
  border-color: #ccc;
  transform: scale(1.05);
}

.known-btn.is-active {
  background: #fff8e1;
  border-color: #fcd34d;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.known-btn.pop {
  animation: known-pop 0.22s ease-out;
}

@keyframes known-pop {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.16); }
  100% { transform: scale(1); }
}

/* SVG star: outline grey by default, filled gold when known */
.known-icon {
  display: block;
  fill: none;
  stroke: #d1d5db;
  stroke-width: 2;
  stroke-linejoin: round;
  transition: fill 0.12s ease, stroke 0.12s ease;
}

.known-btn:hover .known-icon {
  stroke: #f59e0b;
}

.known-btn.is-active .known-icon {
  fill: #f59e0b;
  stroke: #f59e0b;
}

/* ── practice bar ─────────────────────────────────────────────────────────── */
/* Finish button uses .btn-pill-navy from common.css. */

.practice-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  /* Extra bottom clearance for the absolutely-positioned listen-warn tooltip */
  margin-bottom: 28px;
}

/* Prev: bordered ghost circle. Next/Finish: filled navy circle (primary action). */
.practice-nav-btn {
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid var(--color-navy);
  background: transparent;
  color: var(--color-navy);
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.12s ease, color 0.12s ease, opacity 0.12s ease;
  touch-action: manipulation;
}

.practice-nav-btn:hover:not(:disabled) {
  background: var(--color-navy);
  color: white;
}

.practice-nav-btn:disabled {
  opacity: 0.25;
  cursor: default;
}

.practice-nav-btn--primary {
  background: var(--color-navy);
  color: white;
}

.practice-nav-btn--primary:hover:not(:disabled) {
  filter: brightness(1.12);
}

.practice-nav-btn--finish {
  width: auto;
  min-width: 48px;
  padding: 0 18px;
  border-radius: 24px;
  font-size: 15px;
  white-space: nowrap;
  transition: background 0.12s ease, color 0.12s ease, opacity 0.35s ease, transform 0.35s ease;
}

.practice-nav-btn--pending {
  opacity: 0.45;
  cursor: default;
  transform: scale(0.97);
}

@media (prefers-reduced-motion: reduce) {
  .practice-nav-btn--finish { transition: none; }
}

.practice-audio-progress {
  font-size: 12px;
  color: #6b7280;
  white-space: nowrap;
  padding: 0 2px;
}

.practice-audio-counter {
  font-size: 13px;
  color: #374151;
  white-space: nowrap;
  margin-top: 2px;
  font-weight: 500;
}

.practice-note-icon {
  font-size: 1.3em;
  line-height: 1;
}


.practice-progress-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1px;
}

/* Floats below the bar row without shifting button layout */
.practice-listen-warn {
  position: absolute;
  bottom: -22px;
  left: 0;
  right: 0;
  font-size: 12px;
  color: #b45309;
  text-align: center;
  pointer-events: none;
}

.practice-progress {
  padding: 4px 14px;
  background: #dbeafe;
  border: 1px solid var(--color-navy);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-navy);
  white-space: nowrap;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.practice-progress--done {
  background: #bbf7d0;
  border-color: #16a34a;
  color: #15803d;
  transform: scale(1.12);
}

@keyframes practice-done-pulse {
  0%   { transform: scale(1);    }
  40%  { transform: scale(1.18); }
  100% { transform: scale(1.12); }
}

.practice-progress--done-pulse {
  transition: none;
  animation: practice-done-pulse 0.35s ease-out forwards;
}

.practice-progress--no-badge {
  background: #fef3c7;
  border-color: #d97706;
  color: #92400e;
  transform: scale(1);
}

/* ── SRS review recall button ─────────────────────────────────────────────── */
/* Review-mode verbs only (see learn_practice.js): the filled green pill is
   the bar's primary action and the only control that promotes the SRS box;
   the outlined ">" / Finish next to it is the neutral, listen-gated
   secondary. No "Show me again" demote button exists (removed 2026-09-28,
   it behaved like "Recalled it"). Color reuses the green hex already
   present elsewhere in this file (`.practice-progress--done`). */
.practice-recall-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 14px;
  border: none;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  color: white;
  transition: filter 0.12s ease, opacity 0.12s ease;
  touch-action: manipulation;
  flex-shrink: 0;
}

.practice-recall-btn:hover:not(:disabled) {
  filter: brightness(1.1);
}

.practice-recall-btn:disabled {
  opacity: 0.38;
  cursor: default;
}

.practice-recall-btn--yes {
  background: #15803d;
}

/* ── audio loading state ──────────────────────────────────────────────────── */

@keyframes audio-pulse {
  0%   { opacity: 1; }
  50%  { opacity: 0.45; }
  100% { opacity: 1; }
}

.btn.is-loading,
.slow-btn.is-loading {
  animation: audio-pulse 0.9s ease-in-out infinite;
  cursor: wait;
}

/* Override the shared disabled style: we want the button visible but inert. */
.btn.is-loading,
.slow-btn.is-loading {
  opacity: 1;
}

/* ── misc ─────────────────────────────────────────────────────────────────── */
.section-block {
  margin-bottom: 10px;
}

/* ── examples table ───────────────────────────────────────────────────────── */

.examples-table td:first-child {
  width: 65%;
}

.example-src {
  display: block;
}

.example-translation {
  display: none;
  margin-top: 4px;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
}

#learn-page.translations-visible .example-translation:not(:empty) {
  display: block;
}

/* ── infinitive translation (h1 subtitle) ─────────────────────────────────── */
.lemma-translation {
  display: none;
  margin: 0 0 6px 0;
  font-size: 1rem;
  color: var(--text-muted);
  font-style: italic;
}

#learn-page.translations-visible .lemma-translation:not(:empty) {
  display: block;
}

/* ── pronoun reference block (issue #32) ──────────────────────────────────── */
.pronoun-block {
  margin-bottom: 10px;
}

.pronoun-block summary {
  cursor: pointer;
}

/* No border-collapse override -- the global `table` rule (border-radius +
   overflow:hidden for the card look) renders incorrectly with collapsed
   borders in most browsers, clipping/cutting off the first and last rows.
   Falls through to the default border-collapse:separate, matching every
   other table on this page. */
.pronoun-table {
  margin-top: 6px;
  font-size: 0.9rem;
  table-layout: fixed;
}

.pronoun-table td {
  width: 50%;
}

.pronoun-word {
  color: var(--text-body);
}

.pronoun-translation {
  display: none;
  font-style: italic;
  color: var(--text-muted);
  border-inline-start: 1px solid var(--line-soft);
}

/* Independent of the global #toggle-translations/.translations-visible
   mechanism used by examples -- pronoun translations reveal as soon as the
   student unwraps the Pronouns block itself, no extra click needed
   (product decision 2026-09-16, after the shared-toggle dependency was
   repeatedly mistaken for a rendering bug). Native <details> gets the
   [open] attribute automatically -- no new JS. */
.pronoun-block[open] .pronoun-translation:not(:empty) {
  display: table-cell;
}

/* ── jump-to-example button ───────────────────────────────────────────────── */
.jump-example-btn {
  width: 48px;
  height: 48px;
  margin-left: 6px;
  padding: 0;
  border: 1px solid #ddd;
  border-radius: 50%;
  background: #f5f5f5;
  font-size: 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  touch-action: manipulation;
}

[dir="rtl"] .jump-example-btn {
  margin-left: 0;
  margin-right: 6px;
}

.jump-example-btn:hover {
  background: #ececec;
  border-color: #ccc;
  transform: scale(1.05);
}

.jump-example-btn:active {
  transform: scale(0.97);
}

/* ── example row highlight (jump target) ──────────────────────────────────── */
@keyframes example-jump-flash {
  0%   { background-color: #fef3c7; }
  100% { background-color: transparent; }
}

.example-jump-highlight {
  animation: example-jump-flash 1.6s ease-out;
}

/* ── toast (no-match feedback) ────────────────────────────────────────────── */
.vb-toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(12px);
  background: #111827;
  color: white;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.85rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 100;
  max-width: calc(100% - 32px);
  text-align: center;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.25);
}

.vb-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.examples-heading-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.examples-heading-row h2 {
  margin: 0;
}

.toggle-translations-btn {
  border-color: #94a3b8;
  font-weight: 500;
}

.examples-toggle-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* .help-hint* rules moved to common.css (shared: learn + verbs). */

/* ===== Mobile layout ===== */

@media (max-width: 639px) {
  body {
    margin-top: 0;
    /* Preserve horizontal padding from the base rule; add clearance for bottom nav */
    padding-bottom: calc(56px + env(safe-area-inset-bottom));
  }

  h1 {
    font-size: 26px;
  }

  .topbar {
    position: sticky;
    top: env(safe-area-inset-top);
    z-index: 50;
    margin: 0 -16px 16px;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
    padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  }

  /* Practice bar on narrow screens. New-verb mode: Row 1 Prev | counter |
     Next (nav controls stay in thumb zone), Row 2 Abandon pill (fit-content,
     centered). Review mode: Row 1 Prev | counter | outlined Next (or Finish
     pill on the last verb), Row 2 the recall pill (order 3, see
     .practice-recall-btn--yes below), Row 3 Abandon (order 5). DOM order is
     Prev / counter / Abandon / Next / recall, so `order` pulls Abandon (and
     recall, in review mode) onto their own row(s) without touching the HTML.
     Forcing each onto its own row can't be done with width alone: flex-wrap
     decides line breaks from each item's *hypothetical* (pre-grow) size, and
     a short enough pill label (e.g. "Recalled it") is sometimes narrow
     enough to fit the leftover space on row 1 next to Prev/counter even
     though .practice-progress-wrapper has flex:1 -- confirmed by measuring
     actual render at 320px. The old `flex-basis: 100%` guaranteed the wrap
     but, being the pill's own box, also stretched it edge to edge -- the two
     effects can't be separated on the same element. Instead, an empty
     ::before/::after on .practice-bar acts as an invisible, zero-height,
     full-width flex item purely to force the line break; the real button
     that follows keeps a normal fit-content size and is centered on its own
     line via `justify-content: center` (flexbox applies justify-content per
     line, independently -- row 1 is unaffected since its flex:1 wrapper
     already consumes all the free space there). ::after only forces the
     recall->abandon break, so it's gated to review mode via :has(); adding
     it unconditionally would insert a second empty line (extra gap) in the
     far more common non-review flow. */
  .practice-bar {
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 8px;
  }

  /* Nav circles (incl. the secondary Next on review verbs) and counter stay on row 1 */
  .practice-nav-btn { order: 1; }
  .practice-progress-wrapper { order: 1; }

  .practice-bar::before {
    content: "";
    order: 2;
    flex-basis: 100%;
    width: 0;
    height: 0;
  }

  .practice-bar:has(.practice-recall-btn--yes)::after {
    content: "";
    order: 4;
    flex-basis: 100%;
    width: 0;
    height: 0;
  }

  /* Abandon sits on its own row below the nav row, sized to its text */
  .practice-abandon-btn {
    flex: 0 0 auto;
    max-width: 100%;
    text-align: center;
    /* Allow text to wrap inside the pill if it is still too long */
    white-space: normal;
    order: 5;
  }

  /* Review mode: recall button gets its own row above Abandon, sized to its text */
  .practice-recall-btn--yes {
    order: 3;
    flex: 0 0 auto;
    max-width: 100%;
  }
}

/* .topbar-body wraps unconditionally now (see common.css) -- see the matching
   comment on .topbar-nav there (issue #62). */
@media (max-width: 374px) {
  .conj-table th,
  .conj-table td {
    padding: 8px;
  }

  .conj-form {
    gap: 8px;
  }

  .conj-form > span {
    min-width: 0;
    overflow-wrap: anywhere;
  }
}

.stress-note {
  margin: 8px 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}
