.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-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 buttons ────────────────────────────────────────────── */
/* Takes over nextBtn's slot for a review-mode verb (see learn_practice.js) --
   filled pills (not the outline style used by skip/abandon) to keep the same
   visual weight nextBtn had as the bar's one primary action. Colors reuse
   hex values already present elsewhere in this file/common.css (the green
   from .practice-progress--done, the red from .practice-abandon-btn) rather
   than inventing a new palette entry. Distinguished by label text as well as
   color, not color alone (colorblind-safe). */
.practice-recall-group {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.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;
}

.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;
}

.practice-recall-btn--no {
  background: #b91c1c;
}

/* ── 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;
}

/* ── 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: three-row layout on narrow screens.
     Row 1: Prev | counter | Next  (nav controls stay in thumb zone)
     Row 2: Skip pill (full width)
     Row 3: Abandon pill (full width)
     DOM order is Prev / Skip / counter / Abandon / Next, so we use
     `order` to pull Skip and Abandon after Next without touching the HTML. */
  .practice-bar {
    flex-wrap: wrap;
    gap: 6px 8px;
  }

  /* Nav circles and counter stay on row 1 */
  .practice-nav-btn { order: 1; }
  .practice-progress-wrapper { order: 1; }

  /* Skip sits on its own row directly under the counter; Abandon below it */
  .practice-skip-btn,
  .practice-abandon-btn {
    flex: 1 1 100%;
    text-align: center;
    /* Allow text to wrap inside the pill if it is still too long */
    white-space: normal;
  }
  .practice-skip-btn { order: 2; }
  .practice-abandon-btn { order: 3; }

  /* Review mode: recall pair takes skip's old row (order 2), full width,
     split evenly; abandon still falls to its own row below. */
  .practice-recall-group {
    order: 2;
    flex: 1 1 100%;
    gap: 8px;
  }

  .practice-recall-btn {
    flex: 1 1 0;
  }
}
