.vb-page {
  max-width: 600px;
  margin: 0 auto;
  padding-top: 16px;
  padding-left: 12px;
  padding-right: 12px;
  font-family: system-ui, sans-serif;
}

@media (min-width: 640px) {
  .vb-page {
    padding-bottom: 48px;
  }
}

/* ── desktop layout ──────────────────────────────────────────────────────── */
@media (min-width: 768px) {
  .vb-page {
    max-width: 960px;
  }
}

@media (min-width: 1200px) {
  .vb-page {
    max-width: 1200px;
  }

  .vb-list {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ── header ──────────────────────────────────────────────────────────────── */
/* Nav row uses shared .topbar-nav / .topbar-nav-right / .nav-btn from common.css */

.vb-page .topbar-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--page-bg);
  padding-top: calc(8px + env(safe-area-inset-top));
}

.vb-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  flex-shrink: 0;
  white-space: nowrap;
  line-height: 1.2;
}

.vb-lang-select {
  padding: 5px 8px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: white;
  font-size: 13px;
  color: #374151;
  cursor: pointer;
}

/* ── inline search row (below merged controls bar) ───────────────────────── */
.vb-heading-search-row {
  padding: 4px 0 2px;
}

.vb-inline-search {
  width: 100%;
}

/* ── search + controls ───────────────────────────────────────────────────── */
.vb-form {
  margin-bottom: 4px;
}

.vb-search-header {
  margin-top: 14px;
}

.vb-search-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.vb-filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.vb-search {
  flex: 1;
  min-width: 100px;
  height: 40px;
  padding: 0 12px;
  border: 1.5px solid #94a3b8;
  border-radius: 10px;
  font-size: 16px;
  background: white;
  color: #111827;
}
.vb-search:focus {
  outline: none;
  border-color: #4a90e2;
  box-shadow: 0 0 0 2px #2563eb;
}


/* search form */
.vb-toolbar {
  margin-bottom: 8px;
}

/* filter + size toggle (shared segmented control) */
.vb-filter-toggle {
  display: flex;
  flex: 1;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  overflow: hidden;
  background: #f3f4f6;
}
.vb-ftbtn {
  flex: 1 1 0;
  min-width: 0;
  min-height: 44px;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: #6b7280;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  text-align: center;
  touch-action: manipulation;
  transition: background 0.1s, color 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.vb-ftbtn + .vb-ftbtn        { border-left: 1px solid var(--card-border); }
.vb-ftbtn.active              { background: var(--color-navy); color: white; }
.vb-ftbtn:not(.active):hover  { background: #e5e7eb; }

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

@media (max-width: 480px) {
  .vb-controls-row .vb-sort-select {
    max-width: none;
    flex: 1 1 100%;
  }
  .vb-ftbtn {
    flex: 1 1 auto;
  }
}

/* sticky panel: search + controls + title; sits below the topbar */
.vb-sticky-controls {
  position: sticky;
  top: calc(62px + env(safe-area-inset-top));
  z-index: 9;
  background: var(--page-bg);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--card-border);
  margin-bottom: 8px;
}

/* controls row: title label | filter toggle | sort -- single compact bar */
.vb-controls-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.vb-controls-row .vb-filter-row {
  flex: 1;
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 0;
  min-width: 0;
}

.vb-controls-row .vb-sort-select {
  max-width: 130px;
}

/* static progress bar: scrolls with content, sits between sticky and list */
.vb-progress-static {
  padding: 6px 0 4px;
}

.vb-progress-row {
  margin-bottom: 0;
}

.vb-sort-select,
.vb-filter-select {
  height: 44px;
  padding: 0 8px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: white;
  font-size: 13px;
  color: #374151;
  cursor: pointer;
}

.vb-sort-select {
  max-width: 160px;
}

/* ── tap hint ────────────────────────────────────────────────────────────── */
.vb-tap-hint {
  margin: 0 0 2px;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.vb-known-legend {
  margin: 0 0 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ── grid ────────────────────────────────────────────────────────────────── */
.vb-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

@media (max-width: 400px) {
  .vb-list { grid-template-columns: repeat(2, 1fr); }
}

.vb-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  background: white;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  text-decoration: none;
  color: #111827;
  font-size: 15px;
  min-height: 44px;
  transition: background 0.1s, border-color 0.1s;
}
.vb-item:hover    { background: #f0f4ff; border-color: #c7d7f9; box-shadow: 0 2px 8px rgba(37, 99, 235, 0.10); }
.vb-item:active   { background: #e0eaff; box-shadow: none; }
.vb-item.is-known { background: #eff6ff; border-color: #bfdbfe; }
.vb-item.is-seen {
  background: #f0f4f8;
  border-color: #c8d6e5;
}

.vb-lemma {
  flex: 1;
  min-width: 0;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vb-item::after {
  content: "›";
  flex-shrink: 0;
  margin-left: 4px;
  font-size: 0.95rem;
  color: #6b7280;
  transition: color 0.1s;
}

.vb-item:hover::after {
  color: #3b82f6;
}

[dir="rtl"] .vb-item::after {
  content: "‹";
  margin-left: 0;
  margin-right: 4px;
}

.vb-badge        { font-size: 13px; flex-shrink: 0; margin-left: 4px; }
.vb-badge.known  { color: #4a90e2; }

[dir="rtl"] .vb-badge {
  margin-left: 0;
  margin-right: 4px;
}

.vb-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: #9ca3af;
  padding: 32px 0;
  font-size: 15px;
}

.vb-section-label {
  grid-column: 1 / -1;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9ca3af;
  padding: 6px 2px 2px;
}

[dir="rtl"] .vb-section-label {
  letter-spacing: 0;
}

.vb-section-divider {
  grid-column: 1 / -1;
  height: 1px;
  background: #f3f4f6;
  margin: 6px 0;
}

/* ── load more ───────────────────────────────────────────────────────────── */
.vb-load-more-wrap {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  padding: 20px 0 8px;
}

.vb-load-more-btn {
  padding: 10px 28px;
  border: 1.5px solid var(--card-border);
  border-radius: 999px;
  background: white;
  color: var(--color-navy);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}

.vb-load-more-btn:hover  { background: #f0f4ff; border-color: #c7d7f9; }
.vb-load-more-btn:active { background: #e0eaff; }
.vb-load-more-btn:disabled { opacity: 0.5; cursor: default; }

/* ── practice panel ──────────────────────────────────────────────────────── */
/* Size toggle reuses .vb-filter-toggle + .vb-ftbtn (same segmented control). */
/* Action button reuses .btn-pill-navy from common.css.                        */

.practice-panel {
  margin-bottom: 14px;
  scroll-margin-top: 72px;
}

.practice-panel-card {
  border: 1px solid #93c5fd;
  border-top: 3px solid var(--button-primary-bg);
  border-radius: 12px;
  overflow: hidden;
  background: #eff6ff;
  box-shadow: 0 2px 12px rgba(37, 99, 235, 0.08);
}

.practice-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border-bottom: 1px solid #bfdbfe;
  flex-wrap: wrap;
}

.practice-inprogress {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  flex-wrap: wrap;
}

.practice-picker {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 12px;
}

.practice-picker-rows {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

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

.practice-picker-start {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.practice-inprogress {
  background: var(--notice-bg);
}

.practice-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-navy);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

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

.practice-streak {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 9px 2px 7px;
  border-radius: 999px;
  background: var(--notice-bg);
  border: 1px solid var(--notice-border);
  flex-shrink: 0;
  line-height: 1;
}

.practice-streak-flame {
  font-size: 13px;
}

.practice-streak-num {
  font-size: 13px;
  font-weight: 800;
  color: var(--notice-text);
}

[dir="rtl"] .practice-streak {
  padding: 2px 7px 2px 9px;
}

.practice-size-group {
  display: flex;
  gap: 4px;
}

.practice-size-btn {
  padding: 4px 12px;
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid #93c5fd;
  background: white;
  color: #1e40af;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.1s, color 0.1s;
}

.practice-size-btn.active {
  background: var(--color-navy);
  color: white;
  border-color: var(--color-navy);
}

.practice-size-btn:not(.active):hover {
  background: #dbeafe;
}

.practice-size-hint {
  font-size: 12px;
  color: #3b82f6;
  white-space: nowrap;
  font-weight: 600;
  flex-shrink: 0;
}

[dir="rtl"] .practice-size-hint {
  direction: rtl;
  unicode-bidi: embed;
}

.practice-listens-stepper {
  display: flex;
  align-items: center;
  gap: 4px;
}

.practice-listens-btn {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid #93c5fd;
  background: white;
  color: #1e40af;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s, color 0.1s;
  touch-action: manipulation;
}

@media (pointer: coarse) {
  .practice-listens-btn {
    width: 44px;
    height: 44px;
  }
}

.practice-listens-btn:hover:not(:disabled) {
  background: #dbeafe;
}

.practice-listens-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.practice-listens-val {
  min-width: 24px;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--color-navy);
}

.practice-inprogress-label {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--notice-text);
  white-space: nowrap;
}

/* ── badges ───────────────────────────────────────────────────────────────── */
.practice-badges {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding-top: 4px;
  flex-wrap: wrap;
}

.practice-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(160deg, #F5C542 0%, #E09200 100%);
  color: #7A4F00;
  font-size: 12px;
  font-weight: 800;
  position: relative;
  border: 2px solid #C8880A;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.22), inset 0 1px 2px rgba(255, 255, 255, 0.35);
  margin-top: 14px;
}

/* compact grouped badge: count × medal, side by side */
.practice-badge-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.practice-badge-count {
  font-size: 22px;
  font-weight: 800;
  color: #374151;
  line-height: 1;
}

.practice-badge-times {
  font-size: 15px;
  font-weight: 600;
  color: #9ca3af;
  line-height: 1;
}

.practice-badge--ghost {
  background: transparent;
  border: 2px dashed #d1d5db;
  box-shadow: none;
}

.practice-badge--ghost .practice-badge-ribbon {
  background: linear-gradient(180deg, #e5e7eb 0%, #d1d5db 100%);
}

/* ribbon above the medal circle */
.practice-badge-ribbon {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 13px;
  background: linear-gradient(180deg, #7B9ED9 0%, #4A6FA5 100%);
  border-radius: 2px 2px 0 0;
  display: block;
}

/* ── practice wrap-up overlay ────────────────────────────────────────────── */
.practice-wrapup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.practice-wrapup-card {
  background: white;
  border-radius: 16px;
  padding: 28px 28px 22px;
  max-width: 420px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
}

.practice-wrapup-card h3 {
  margin: 0 0 6px;
  font-size: 20px;
  color: var(--color-navy, #1e3a5f);
}

.practice-wrapup-card p {
  margin: 0 0 18px;
  font-size: 15px;
  color: var(--text-muted, #6b7280);
}

.practice-wrapup-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 22px;
}

.practice-wrapup-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  cursor: pointer;
  user-select: none;
}

.practice-wrapup-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  flex-shrink: 0;
  accent-color: var(--color-navy, #1e3a5f);
}

.practice-wrapup-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

[dir="rtl"] .practice-wrapup-actions {
  justify-content: flex-start;
}

.practice-wrapup-star {
  font-size: 16px;
  color: #f59e0b;
  line-height: 1;
}

.practice-wrapup-streak {
  margin-top: -8px;
  margin-bottom: 18px;
  font-size: 14px;
  font-weight: 700;
  color: var(--notice-text);
}
