/* ============================================================
   Vocabulary World — vocabulary.css
   Public browse + set view + games (BWS UI only, no Bootstrap)
   ============================================================ */

/* ── Browse page ────────────────────────────────────────────── */
.lrn-vocab-hero {
  background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
  color: #fff;
  padding: 3rem 1.25rem 2.5rem;
  text-align: center;
}
.lrn-vocab-hero-icon { font-size: 3rem; margin-bottom: .5rem; }
.lrn-vocab-hero h1   { font-size: 2rem; font-weight: 900; margin: 0 0 .5rem; }
.lrn-vocab-hero p    { font-size: 1.05rem; opacity: .88; margin: 0; }

/* Rich hero stats */
.lrn-vocab-hero--rich { padding-bottom: 2.75rem; }
.lrn-vocab-hero-stats {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}
.lrn-vocab-hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255,255,255,.15);
  border-radius: 1rem;
  padding: .5rem .9rem;
  min-width: 70px;
}
.lrn-vocab-hero-stat-n {
  font-size: 1.6rem;
  font-weight: 900;
  line-height: 1;
}
.lrn-vocab-hero-stat-l {
  font-size: .72rem;
  font-weight: 700;
  opacity: .85;
  margin-top: .15rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.lrn-vocab-hero-badges {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: .45rem;
  margin-top: 1rem;
}
.lrn-vocab-hero-badge {
  font-size: .78rem;
  font-weight: 700;
  padding: .25rem .7rem;
  border-radius: 2rem;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  white-space: nowrap;
}

/* Category grid */
.lrn-vocab-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
  padding: 2rem 1.25rem;
  max-width: 1000px;
  margin: 0 auto;
}
.lrn-vocab-cat-card {
  background: #fff;
  border: 2px solid #e5e7eb;
  border-radius: 1.25rem;
  padding: 1.5rem 1.25rem;
  text-decoration: none;
  color: inherit;
  transition: transform .18s, box-shadow .18s, border-color .18s;
  display: block;
}
.lrn-vocab-cat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,.1);
  border-color: var(--cat-color, #7c3aed);
}
.lrn-vocab-cat-icon {
  font-size: 2.5rem;
  margin-bottom: .75rem;
  display: block;
}
.lrn-vocab-cat-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: #1f2937;
  margin: 0 0 .3rem;
}
.lrn-vocab-cat-meta {
  font-size: .78rem;
  color: #6b7280;
}
.lrn-vocab-cat-sub-list {
  margin-top: .65rem;
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}
.lrn-vocab-cat-sub-pill {
  font-size: .72rem;
  font-weight: 700;
  padding: .15rem .55rem;
  border-radius: 2rem;
  background: #f3f4f6;
  color: #4b5563;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.lrn-vocab-cat-sub-pill:hover {
  background: #7c3aed;
  color: #fff;
}

/* Set grid */
.lrn-vocab-set-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  padding: 1.5rem 1.25rem 3rem;
  max-width: 1100px;
  margin: 0 auto;
}
.lrn-vocab-set-card {
  background: #fff;
  border: 2px solid #e5e7eb;
  border-radius: 1.25rem;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: transform .18s, box-shadow .18s;
}
.lrn-vocab-set-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,.1);
}
.lrn-vocab-set-card-cover {
  height: 140px;
  background: linear-gradient(135deg, #f3f0ff, #ede9fe);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  overflow: hidden;
}
.lrn-vocab-set-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.lrn-vocab-set-card-body {
  padding: 1rem 1.1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.lrn-vocab-set-card-title {
  font-size: 1rem;
  font-weight: 800;
  color: #1f2937;
  margin: 0 0 .3rem;
  line-height: 1.3;
}
.lrn-vocab-set-card-desc {
  font-size: .82rem;
  color: #6b7280;
  margin: 0 0 .75rem;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.lrn-vocab-set-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}
.lrn-vocab-diff-badge {
  font-size: .7rem;
  font-weight: 700;
  padding: .18rem .55rem;
  border-radius: 2rem;
  text-transform: capitalize;
}
.lrn-vocab-diff-badge--easy   { background: #dcfce7; color: #166534; }
.lrn-vocab-diff-badge--medium { background: #fef3c7; color: #92400e; }
.lrn-vocab-diff-badge--hard   { background: #fee2e2; color: #991b1b; }
.lrn-vocab-word-count { font-size: .78rem; color: #9ca3af; }

/* ── Category/Set page header ──────────────────────────────── */
.lrn-vocab-page-header {
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  color: #fff;
  padding: 2.5rem 1.25rem 2rem;
}
.lrn-vocab-page-header h1 {
  font-size: 1.75rem;
  font-weight: 900;
  margin: .5rem 0 .4rem;
}
.lrn-vocab-page-header p {
  font-size: .95rem;
  opacity: .88;
  margin: 0;
}
.lrn-vocab-breadcrumb {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
  font-size: .8rem;
  opacity: .82;
  margin-bottom: .75rem;
  list-style: none;
  padding: 0;
}
.lrn-vocab-breadcrumb a { color: #e9d5ff; text-decoration: none; }
.lrn-vocab-breadcrumb a:hover { text-decoration: underline; }

/* ── Set view page ─────────────────────────────────────────── */
.lrn-vocab-set-wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 1.25rem 4rem;
}

/* Word cards (browse/flashcard mode) */
.lrn-vocab-word-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.lrn-vocab-word-card {
  perspective: 600px;
  height: 96px;
  cursor: pointer;
}
.lrn-vocab-word-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform .5s;
  transform-style: preserve-3d;
}
.lrn-vocab-word-card:hover .lrn-vocab-word-front,
.lrn-vocab-word-card:focus-visible .lrn-vocab-word-front,
.lrn-vocab-word-card.is-selected .lrn-vocab-word-front {
  border-color: #c4b5fd;
  box-shadow: 0 6px 16px rgba(124,58,237,.12);
}
.lrn-vocab-word-front,
.lrn-vocab-word-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: .75rem;
  border: 2px solid #e5e7eb;
}
.lrn-vocab-word-front {
  background: #fff;
  flex-direction: row;
  gap: .65rem;
  text-align: left;
}
.lrn-vocab-word-front-img {
  width: 60px;
  height: 60px;
  border-radius: .5rem;
  object-fit: cover;
  flex-shrink: 0;
}
.lrn-vocab-word-front-text {
  min-width: 0;
  overflow: hidden;
}
.lrn-vocab-word-front-text strong {
  font-size: .95rem;
  font-weight: 800;
  color: #1f2937;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lrn-vocab-word-front-text em {
  font-size: .72rem;
  color: #7c3aed;
  font-style: normal;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
  margin-top: .15rem;
}
.lrn-vocab-word-back {
  display: none;
}
.lrn-vocab-word-back strong {
  font-size: 1.05rem;
  display: block;
  margin-bottom: .3rem;
}
.lrn-vocab-word-back-definition,
.lrn-vocab-word-back-example {
  display: block;
  max-width: 100%;
}
.lrn-vocab-word-back-definition {
  font-size: .78rem;
  line-height: 1.35;
  opacity: .9;
}
.lrn-vocab-word-back-example {
  margin-top: .25rem;
  font-size: .72rem;
  line-height: 1.3;
  opacity: .78;
}
.lrn-vocab-word-mastery {
  display: flex;
  gap: 3px;
  margin-top: .4rem;
}
.lrn-vocab-word-mastery-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,.3);
}
.lrn-vocab-word-mastery-dot.filled { background: #fde68a; }

/* Listen button on flash card front */
.lrn-vocab-listen-btn {
  position: absolute;
  bottom: .4rem;
  right: .4rem;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: #f5f3ff;
  color: #7c3aed;
  font-size: .9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background .15s, transform .12s;
  line-height: 1;
}
.lrn-vocab-listen-btn:hover { background: #ede9fe; transform: scale(1.15); }
.lrn-vocab-listen-btn:active { transform: scale(.95); }
.lrn-vocab-modal-open { overflow: hidden; }
.lrn-vocab-word-modal {
  position: fixed;
  inset: 0;
  z-index: 5200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.lrn-vocab-word-modal[hidden] { display: none; }
.lrn-vocab-word-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(30,27,75,.56);
  cursor: pointer;
}
.lrn-vocab-word-detail {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 88px minmax(0,1fr);
  gap: 1rem;
  align-items: center;
  width: min(34rem,100%);
  max-height: min(38rem,calc(100vh - 2rem));
  overflow-y: auto;
  padding: 1rem 2.75rem 1rem 1rem;
  border: 2px solid #c4b5fd;
  border-radius: 1rem;
  background: linear-gradient(135deg,#fff,#f5f3ff);
  box-shadow: 0 22px 52px rgba(30,27,75,.3);
}
.lrn-vocab-word-detail-img {
  width: 88px;
  height: 68px;
  border-radius: .65rem;
  object-fit: contain;
  background: #fff;
}
.lrn-vocab-word-detail-copy h2 {
  margin: 0 0 .3rem;
  color: #4c1d95;
  font-size: 1.1rem;
}
.lrn-vocab-word-detail-copy p {
  margin: 0;
  color: #374151;
  font-size: .9rem;
  font-weight: 700;
  line-height: 1.5;
}
.lrn-vocab-word-detail-example {
  margin-top: .35rem !important;
  color: #6d28d9 !important;
  font-size: .82rem !important;
  font-style: italic;
}
.lrn-vocab-word-detail-close {
  position: absolute;
  top: .55rem;
  right: .65rem;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 999px;
  background: #ede9fe;
  color: #5b21b6;
  cursor: pointer;
  font-size: 1.25rem;
  font-weight: 900;
}
.lrn-vocab-word-detail-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: .55rem;
}
.lrn-vocab-word-detail-btn {
  min-height: 2.65rem;
  border: 2px solid #c4b5fd;
  border-radius: 999px;
  background: #fff;
  color: #5b21b6;
  cursor: pointer;
  font-family: inherit;
  font-weight: 900;
  padding: .55rem .8rem;
}
.lrn-vocab-word-detail-btn--listen {
  border-color: #7c3aed;
  background: #7c3aed;
  color: #fff;
}
.lrn-vocab-word-detail-btn:disabled {
  cursor: default;
  opacity: .45;
}
@media (max-width: 520px) {
  .lrn-vocab-word-detail { grid-template-columns: 1fr; }
  .lrn-vocab-word-detail-img { width: 100%; height: 8rem; }
}

/* ── Game tabs ─────────────────────────────────────────────── */
.lrn-vocab-tabs {
  display: flex;
  gap: .35rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 1.25rem 0 0;
  border-bottom: 2px solid #e5e7eb;
  margin-bottom: 1.5rem;
}
.lrn-vocab-tabs::-webkit-scrollbar { display: none; }
.lrn-vocab-tab {
  flex-shrink: 0;
  padding: .5rem .9rem;
  border-radius: .75rem .75rem 0 0;
  border: 2px solid transparent;
  border-bottom: none;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  background: transparent;
  color: #6b7280;
  font-family: inherit;
  position: relative;
  bottom: -2px;
  transition: color .15s, background .15s;
}
.lrn-vocab-tab:hover { color: #7c3aed; background: #f5f3ff; }
.lrn-vocab-tab.active {
  color: #7c3aed;
  background: #fff;
  border-color: #e5e7eb;
  border-bottom-color: #fff;
}
.lrn-vocab-tab-panel { display: none; }
.lrn-vocab-tab-panel.active { display: block; }

/* ── Print row ─────────────────────────────────────────────── */
.lrn-vocab-print-row {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  padding: 1.5rem 0 .5rem;
  border-top: 2px solid #e5e7eb;
  margin-top: 2rem;
}
.lrn-vocab-print-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem 1rem;
  border-radius: .65rem;
  font-size: .82rem;
  font-weight: 700;
  text-decoration: none;
  border: 2px solid #e5e7eb;
  color: #374151;
  background: #fff;
  transition: background .15s, border-color .15s, color .15s;
  cursor: pointer;
  font-family: inherit;
}
.lrn-vocab-print-btn:hover {
  background: #7c3aed;
  border-color: #7c3aed;
  color: #fff;
}

/* ── Game wrapper ──────────────────────────────────────────── */
.lrn-vocab-game-wrap {
  background: #f9fafb;
  border-radius: 1.25rem;
  padding: 1.25rem;
  min-height: 320px;
}
.lrn-vocab-game-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #1f2937;
  margin: 0 0 1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.lrn-vocab-game-actions {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.lrn-vocab-game-score {
  font-size: .85rem;
  color: #6b7280;
  font-weight: 700;
  margin-bottom: .75rem;
}
/* Win overlay */
.lrn-vocab-win {
  text-align: center;
  padding: 2.5rem 1rem;
  animation: lrnVocabFadeIn .4s ease;
}
.lrn-vocab-win-icon { font-size: 4rem; margin-bottom: .75rem; }
.lrn-vocab-win h3 { font-size: 1.5rem; font-weight: 900; color: #1f2937; margin: 0 0 .5rem; }
.lrn-vocab-win p  { color: #6b7280; margin: 0 0 1.25rem; }
@keyframes lrnVocabFadeIn {
  from { opacity: 0; transform: scale(.95); }
  to   { opacity: 1; transform: scale(1); }
}

/* ── Word Search ───────────────────────────────────────────── */
.lrn-ws-wrap { display: flex; flex-direction: column; gap: 1.25rem; }
@media (min-width: 640px) {
  .lrn-ws-wrap { flex-direction: row; align-items: flex-start; }
}
.lrn-ws-grid-wrap { overflow-x: auto; }
.lrn-ws-grid {
  display: inline-grid;
  border: 2px solid #d1d5db;
  border-radius: .75rem;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.lrn-ws-cell {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .82rem;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #1f2937;
  cursor: default;
  transition: background .08s;
}
.lrn-ws-cell.selecting { background: #c4b5fd; }
.lrn-ws-cell.found     { background: #bbf7d0; color: #166534; }
.lrn-ws-cell.found.selecting { background: #bbf7d0; }
.lrn-ws-word-list { flex: 1; min-width: 140px; }
.lrn-ws-word-item {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .85rem;
  font-weight: 700;
  padding: .3rem 0;
  color: #374151;
  border-bottom: 1px solid #f3f4f6;
  transition: color .15s;
}
.lrn-ws-word-item.found { color: #16a34a; text-decoration: line-through; }
.lrn-ws-word-found-badge { font-size: .65rem; }

/* ── Scramble ──────────────────────────────────────────────── */
.lrn-sc-progress { margin-bottom: 1rem; }
.lrn-sc-progress-bar {
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: .35rem;
}
.lrn-sc-progress-fill { height: 100%; background: #7c3aed; border-radius: 4px; transition: width .3s; }
.lrn-sc-clue {
  background: #fff;
  border: 2px solid #e5e7eb;
  border-radius: 1rem;
  padding: 1rem;
  margin-bottom: 1rem;
  text-align: center;
}
.lrn-sc-clue-img {
  max-height: 120px;
  border-radius: .5rem;
  margin-bottom: .5rem;
  object-fit: contain;
}
.lrn-sc-clue-def {
  font-size: .9rem;
  color: #374151;
  font-style: italic;
}
.lrn-sc-answer-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: .35rem;
  min-height: 56px;
  background: #fff;
  border: 2px dashed #d1d5db;
  border-radius: .75rem;
  padding: .5rem;
  margin-bottom: .75rem;
}
.lrn-sc-answer-slot {
  min-width: 44px;
  height: 44px;
  background: #f5f3ff;
  border: 2px solid #c4b5fd;
  border-radius: .5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 800;
  color: #7c3aed;
  cursor: pointer;
  transition: background .12s;
}
.lrn-sc-answer-slot:hover { background: #ede9fe; }
.lrn-sc-answer-slot.correct { background: #dcfce7; border-color: #86efac; color: #166534; }
.lrn-sc-answer-slot.wrong   { background: #fee2e2; border-color: #fca5a5; color: #991b1b; }
.lrn-sc-tile-pool {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: .35rem;
  padding: .5rem 0;
}
.lrn-sc-tile {
  min-width: 44px;
  height: 44px;
  background: #7c3aed;
  color: #fff;
  border-radius: .5rem;
  border: none;
  font-size: 1.15rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  transition: background .12s, transform .1s;
  padding: 0 .4rem;
}
.lrn-sc-tile:hover   { background: #5b21b6; transform: translateY(-2px); }
.lrn-sc-tile:active  { transform: translateY(0); }
.lrn-sc-tile:disabled { background: #e5e7eb; color: #9ca3af; cursor: default; transform: none; }

/* ── Crossword ─────────────────────────────────────────────── */
.lrn-cw-wrap { display: flex; flex-direction: column; gap: 1.5rem; }
@media (min-width: 640px) {
  .lrn-cw-wrap { flex-direction: row; align-items: flex-start; }
}
.lrn-cw-grid-wrap { overflow-x: auto; flex-shrink: 0; }
.lrn-cw-grid { border-collapse: collapse; }
.lrn-cw-cell {
  width: 36px;
  height: 36px;
  border: 2px solid #9ca3af;
  position: relative;
  padding: 0;
}
.lrn-cw-cell.black { background: #1f2937; border-color: #1f2937; }
.lrn-cw-cell input {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  text-align: center;
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 0;
  outline: none;
  cursor: pointer;
  color: #1f2937;
}
.lrn-cw-cell input:focus { background: #fef9c3; }
.lrn-cw-cell input.correct { color: #16a34a; }
.lrn-cw-cell input.wrong   { color: #dc2626; }
.lrn-cw-num {
  position: absolute;
  top: 1px;
  left: 2px;
  font-size: .55rem;
  font-weight: 800;
  color: #374151;
  line-height: 1;
  pointer-events: none;
}
.lrn-cw-cell.highlighted input { background: #e0e7ff; }
.lrn-cw-clues { flex: 1; font-size: .82rem; }
.lrn-cw-clues h4 { font-size: .9rem; font-weight: 800; color: #374151; margin: 0 0 .5rem; }
.lrn-cw-clue-item {
  display: flex;
  gap: .4rem;
  padding: .25rem 0;
  border-bottom: 1px solid #f3f4f6;
  cursor: pointer;
  border-radius: .25rem;
  transition: background .1s;
}
.lrn-cw-clue-item:hover { background: #f5f3ff; }
.lrn-cw-clue-item.active { background: #ede9fe; }
.lrn-cw-clue-num { font-weight: 800; color: #7c3aed; min-width: 20px; }
.lrn-cw-clue-text { color: #374151; }

/* ── Memory Match ──────────────────────────────────────────── */
.lrn-mem-grid {
  display: grid;
  gap: .65rem;
  margin: 0 auto;
}
.lrn-mem-card {
  perspective: 800px;
  cursor: pointer;
  height: 90px;
}
.lrn-mem-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform .4s;
  transform-style: preserve-3d;
}
.lrn-mem-card.flipped .lrn-mem-inner { transform: rotateY(180deg); }
.lrn-mem-card.matched .lrn-mem-inner { transform: rotateY(180deg); }
.lrn-mem-front,
.lrn-mem-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: .75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .5rem;
  text-align: center;
  font-size: .82rem;
  font-weight: 700;
}
.lrn-mem-front {
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  font-size: 1.5rem;
  color: rgba(255,255,255,.6);
}
.lrn-mem-back {
  background: #fff;
  border: 2px solid #e5e7eb;
  color: #1f2937;
  transform: rotateY(180deg);
  line-height: 1.3;
}
.lrn-mem-card.matched .lrn-mem-back {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}

/* ── Print page ────────────────────────────────────────────── */
.lrn-vocab-print-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.lrn-vocab-print-header {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 3px solid #7c3aed;
}
.lrn-vocab-print-header h1 { font-size: 1.5rem; margin: 0 0 .25rem; color: #1f2937; }
.lrn-vocab-print-header p  { font-size: .85rem; color: #6b7280; margin: 0; }
.lrn-vocab-print-answer-key-label {
  display: inline-block;
  background: #fef3c7;
  border: 2px solid #fde68a;
  border-radius: .5rem;
  padding: .2rem .7rem;
  font-size: .8rem;
  font-weight: 800;
  color: #92400e;
  margin-top: .5rem;
}

/* Tracer print */
.lrn-vocab-tracer-item {
  margin-bottom: 2rem;
  break-inside: avoid;
}
.lrn-vocab-tracer-word {
  font-size: 2.5rem;
  font-weight: 900;
  letter-spacing: .12em;
  color: #d1d5db;
  margin-bottom: .4rem;
  font-family: 'Courier New', monospace;
}
.lrn-vocab-tracer-def {
  font-size: .82rem;
  color: #6b7280;
  margin-bottom: .5rem;
}
.lrn-vocab-tracer-lines {
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
  margin-top: .75rem;
}
.lrn-vocab-tracer-line {
  border-bottom: 1.5px solid #d1d5db;
  height: 40px;
}

@media print {
  .lrn-vocab-print-controls,
  .cp-toolbar { display: none !important; }
  body { background: #fff; }
  .lrn-vocab-print-page { padding: 0; }
  .lrn-ws-cell { width: 28px; height: 28px; font-size: .7rem; }
  .lrn-cw-cell { width: 30px; height: 30px; }
}
