/* ═══════════════════════════════════════════════════════════════
   LEARN HEBREW — Dark Mode CSS
   Mobile-first, clean, beautiful
═══════════════════════════════════════════════════════════════ */

/* ── Custom Properties ───────────────────────────────────────── */
:root {
  --bg:          #0d0d14;
  --bg-2:        #13131e;
  --bg-3:        #1c1c2e;
  --bg-4:        #252540;
  --border:      #2e2e50;
  --border-light:#3a3a60;

  --primary:     #7c6af5;
  --primary-h:   #9d8ff7;
  --primary-dim: rgba(124,106,245,.15);

  --accent:      #e8a87c;
  --accent-dim:  rgba(232,168,124,.15);

  --success:     #4caf7d;
  --success-dim: rgba(76,175,125,.15);
  --error:       #e05a5a;
  --error-dim:   rgba(224,90,90,.15);

  --text-1:      #f0f0f8;
  --text-2:      #b0b0cc;
  --text-3:      #7070a0;

  --nav-h:       56px;
  --radius:      12px;
  --radius-lg:   20px;
  --shadow:      0 4px 24px rgba(0,0,0,.4);
  --shadow-sm:   0 2px 8px rgba(0,0,0,.3);

  --font-body:   'Inter', system-ui, sans-serif;
  --font-hebrew: 'Heebo', 'Arial Hebrew', sans-serif;
  --transition:  .2s ease;
}

/* ── Reset & Base ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-tap-highlight-color: transparent; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-1);
  min-height: 100dvh;
  overflow-x: hidden;
  line-height: 1.5;
}

/* Hebrew text always uses Heebo */
[dir="rtl"], .hebrew { font-family: var(--font-hebrew); }

/* ── Utility ─────────────────────────────────────────────────── */
.hidden { display: none !important; }
.screen { min-height: 100dvh; }

.error-msg { color: var(--error); font-size: .875rem; margin-top: .5rem; }
.msg { font-size: .875rem; margin-top: .5rem; }
.msg.success { color: var(--success); }
.msg.error   { color: var(--error); }

.section-hint {
  color: var(--text-3);
  font-size: .875rem;
  margin-bottom: 1.25rem;
}

/* ── Scrollbar ───────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }

/* ═══════════════════════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .65rem 1.25rem;
  border-radius: var(--radius);
  border: none;
  font-family: var(--font-body);
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), opacity var(--transition), transform var(--transition);
  white-space: nowrap;
  user-select: none;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.btn-primary  { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-h); }

.btn-secondary {
  background: var(--bg-4);
  color: var(--text-2);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--border); color: var(--text-1); }

.btn-full   { width: 100%; }
.btn-large  { padding: .85rem 1.75rem; font-size: 1rem; }
.btn-sm     { padding: .4rem .8rem; font-size: .8rem; }

.btn-wrong {
  flex: 1;
  background: var(--error-dim);
  color: var(--error);
  border: 1px solid var(--error);
  font-size: .95rem;
  padding: .8rem;
}
.btn-wrong:hover { background: var(--error); color: #fff; }

.btn-right {
  flex: 1;
  background: var(--success-dim);
  color: var(--success);
  border: 1px solid var(--success);
  font-size: .95rem;
  padding: .8rem;
}
.btn-right:hover { background: var(--success); color: #fff; }

.btn-audio {
  background: var(--bg-4);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), transform var(--transition);
}
.btn-audio:hover  { background: var(--primary-dim); border-color: var(--primary); }
.btn-audio:active { transform: scale(.9); }

/* ═══════════════════════════════════════════════════════════════
   FORM ELEMENTS
═══════════════════════════════════════════════════════════════ */
.field-group { display: flex; flex-direction: column; gap: .4rem; }
.field-group label { font-size: .8rem; font-weight: 500; color: var(--text-2); text-transform: uppercase; letter-spacing: .05em; }

input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-1);
  font-family: var(--font-body);
  font-size: .95rem;
  padding: .65rem .9rem;
  width: 100%;
  transition: border-color var(--transition);
  outline: none;
  -webkit-appearance: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
}
input::placeholder, textarea::placeholder { color: var(--text-3); }

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237070a0' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .75rem center;
  padding-right: 2.25rem;
  cursor: pointer;
}

.search-input { background: var(--bg-3); }

.field-row {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
}
.field-row .field-group { flex: 1; min-width: 140px; }

/* ═══════════════════════════════════════════════════════════════
   LOGIN SCREEN
═══════════════════════════════════════════════════════════════ */
#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: var(--bg);
  min-height: 100dvh;
}

.login-container {
  width: 100%;
  max-width: 380px;
}

.login-logo {
  text-align: center;
  margin-bottom: 2.5rem;
}

.login-logo-hebrew {
  display: block;
  font-family: var(--font-hebrew);
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  margin-bottom: .5rem;
  text-shadow: 0 0 40px rgba(124,106,245,.4);
}

.login-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: .25rem;
}

.login-subtitle {
  font-size: .9rem;
  color: var(--text-3);
}

.login-form {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#login-btn .btn-spinner {
  display: inline-block;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════════════
   NAVIGATION
═══════════════════════════════════════════════════════════════ */
#main-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  backdrop-filter: blur(12px);
}

.nav-inner {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 1rem;
  max-width: 900px;
  margin: 0 auto;
  gap: .5rem;
}

.nav-logo {
  font-family: var(--font-hebrew);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
  flex-shrink: 0;
  margin-right: auto;
}

.nav-tabs {
  display: flex;
  gap: .25rem;
}

.nav-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: .35rem .6rem;
  border: none;
  background: transparent;
  color: var(--text-3);
  font-family: var(--font-body);
  font-size: .7rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius);
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
}
.nav-tab .nav-icon { font-size: 1.1rem; }
.nav-tab:hover { color: var(--text-2); background: var(--bg-3); }
.nav-tab.active { color: var(--primary); background: var(--primary-dim); }

.btn-logout {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-3);
  font-size: 1rem;
  width: 2.25rem;
  height: 2.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color var(--transition), border-color var(--transition);
}
.btn-logout:hover { color: var(--error); border-color: var(--error); }

/* ═══════════════════════════════════════════════════════════════
   APP SECTIONS
═══════════════════════════════════════════════════════════════ */
.app-section {
  display: none;
  padding-top: calc(var(--nav-h) + 1.25rem);
  min-height: 100dvh;
}
.app-section.active { display: block; }

.section-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1rem 3rem;
}

/* ── Sub-tabs ────────────────────────────────────────────────── */
.sub-tabs, .admin-sub-tabs {
  display: flex;
  gap: .5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: .75rem;
}

.sub-tab {
  padding: .45rem .9rem;
  border-radius: var(--radius);
  border: none;
  background: transparent;
  color: var(--text-3);
  font-family: var(--font-body);
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.sub-tab:hover  { color: var(--text-2); background: var(--bg-3); }
.sub-tab.active { color: var(--primary); background: var(--primary-dim); }

.sub-section { display: none; }
.sub-section.active { display: block; }

/* ═══════════════════════════════════════════════════════════════
   ALPHABET GRID
═══════════════════════════════════════════════════════════════ */
.alphabet-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .75rem;
}

@media (min-width: 480px) { .alphabet-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 640px) { .alphabet-grid { grid-template-columns: repeat(5, 1fr); } }
@media (min-width: 800px) { .alphabet-grid { grid-template-columns: repeat(6, 1fr); } }

.letter-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem .75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
  user-select: none;
}
.letter-card:hover  { border-color: var(--primary); background: var(--bg-3); }
.letter-card:active { transform: scale(.96); }
.letter-card.playing { border-color: var(--accent); background: var(--accent-dim); }

.letter-char {
  font-family: var(--font-hebrew);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1;
  direction: rtl;
}
.letter-final {
  font-family: var(--font-hebrew);
  font-size: 1.1rem;
  color: var(--text-3);
  direction: rtl;
}
.letter-name  { font-size: .8rem; font-weight: 600; color: var(--text-2); }
.letter-sound { font-size: .75rem; color: var(--text-3); }
.letter-example {
  font-family: var(--font-hebrew);
  font-size: .9rem;
  color: var(--accent);
  direction: rtl;
}

/* ═══════════════════════════════════════════════════════════════
   WORDS TABLE
═══════════════════════════════════════════════════════════════ */
.words-controls {
  display: flex;
  gap: .75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.words-controls .search-input { flex: 1; min-width: 160px; }
.words-controls select { width: auto; }

.words-stats {
  font-size: .85rem;
  color: var(--text-3);
  margin-bottom: .75rem;
}

#words-table-wrap { overflow-x: auto; }

.words-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}
.words-table th {
  text-align: left;
  padding: .6rem .75rem;
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .05em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.words-table td {
  padding: .6rem .75rem;
  border-bottom: 1px solid var(--bg-3);
  vertical-align: middle;
}
.words-table tr:last-child td { border-bottom: none; }
.words-table tr:hover td { background: var(--bg-2); }

.words-table .cell-hebrew {
  font-family: var(--font-hebrew);
  font-size: 1.1rem;
  font-weight: 600;
  direction: rtl;
  white-space: nowrap;
}
.words-table .cell-translit { color: var(--text-3); font-style: italic; }

.badge {
  display: inline-block;
  padding: .2rem .55rem;
  border-radius: 99px;
  font-size: .73rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-learned  { background: var(--success-dim); color: var(--success); }
.badge-new      { background: var(--bg-4); color: var(--text-3); }
.badge-mastered { background: var(--primary-dim); color: var(--primary); }
.badge-admin    { background: var(--accent-dim); color: var(--accent); }
.badge-learner  { background: var(--bg-4); color: var(--text-3); }

.cell-audio { width: 2.5rem; }

/* ═══════════════════════════════════════════════════════════════
   FLASHCARDS
═══════════════════════════════════════════════════════════════ */
.flashcards-start, .flashcards-done {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem 0;
  text-align: center;
}
.flashcards-start h2, .flashcards-done h2 {
  font-size: 1.5rem;
  font-weight: 600;
}

.fc-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .75rem;
  width: 100%;
  max-width: 400px;
}
.fc-stat {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .75rem;
  text-align: center;
}
.fc-stat-num  { font-size: 1.6rem; font-weight: 700; color: var(--text-1); line-height: 1; }
.fc-stat-lbl  { font-size: .72rem; color: var(--text-3); margin-top: .2rem; }

.flashcards-session { display: flex; flex-direction: column; gap: 1rem; }

.fc-progress-bar-wrap {
  height: 4px;
  background: var(--bg-3);
  border-radius: 2px;
  overflow: hidden;
}
.fc-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 2px;
  transition: width .4s ease;
  width: 0%;
}

.fc-counter {
  font-size: .85rem;
  color: var(--text-3);
  text-align: center;
}

/* Card */
.fc-card {
  perspective: 1000px;
  min-height: 320px;
  cursor: pointer;
}
.fc-card-inner {
  position: relative;
  min-height: 320px;
  transform-style: preserve-3d;
  transition: transform .55s cubic-bezier(.4,0,.2,1);
}
.fc-card[data-flipped="true"] .fc-card-inner {
  transform: rotateY(180deg);
}

.fc-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem 1.5rem;
}
.fc-face.fc-back {
  transform: rotateY(180deg);
  justify-content: flex-start;
  padding-top: 1.75rem;
}

.fc-hebrew {
  font-family: var(--font-hebrew);
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--text-1);
  text-align: center;
  line-height: 1.2;
  direction: rtl;
}
.fc-flip-btn { margin-top: .5rem; }

.fc-pronunciation {
  font-size: 1.4rem;
  color: var(--accent);
  font-style: italic;
  font-weight: 500;
  text-align: center;
}
.fc-divider {
  width: 40px;
  height: 1px;
  background: var(--border);
  align-self: center;
}
.fc-english {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-1);
  text-align: center;
}

.fc-streak-dots {
  display: flex;
  gap: .4rem;
  margin-top: .25rem;
}
.streak-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bg-4);
  border: 1px solid var(--border);
  transition: background var(--transition);
}
.streak-dot.filled { background: var(--success); border-color: var(--success); }

.fc-answer-btns {
  display: flex;
  gap: .75rem;
  width: 100%;
  margin-top: auto;
}

/* Done screen */
.done-icon { font-size: 3rem; }
.done-stats {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 2rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  text-align: center;
  min-width: 200px;
}
.done-stat-row { font-size: .9rem; color: var(--text-2); }
.done-stat-row strong { color: var(--text-1); }

/* ═══════════════════════════════════════════════════════════════
   TRANSLATION
═══════════════════════════════════════════════════════════════ */
.translation-idle, .translation-done {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem 0;
  text-align: center;
}
.translation-idle h2, .translation-done h2 { font-size: 1.5rem; font-weight: 600; }

.trans-stats {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .75rem 1.25rem;
  font-size: .85rem;
  color: var(--text-2);
}

.translation-exercise { display: flex; flex-direction: column; gap: 1.25rem; }

.trans-progress {
  display: flex;
  justify-content: space-between;
  font-size: .85rem;
  color: var(--text-3);
}

.trans-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
}
.trans-label {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-3);
  margin-bottom: .75rem;
  font-weight: 600;
}
.trans-english {
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--text-1);
  line-height: 1.4;
}

.trans-input-wrap { display: flex; flex-direction: column; gap: .5rem; }
.trans-input {
  font-family: var(--font-hebrew);
  font-size: 1.3rem;
  line-height: 1.5;
  resize: vertical;
  min-height: 80px;
  text-align: right;
}

.trans-feedback {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.trans-result-label {
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
}
.trans-result-label.correct { color: var(--success); }
.trans-result-label.wrong   { color: var(--error); }

.trans-comparison { display: flex; flex-direction: column; gap: .75rem; }
.trans-comp-row { display: flex; flex-direction: column; gap: .25rem; }
.comp-label { font-size: .75rem; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.comp-text {
  font-family: var(--font-hebrew);
  font-size: 1.2rem;
  color: var(--text-2);
  direction: rtl;
  text-align: right;
}
.comp-correct { color: var(--success); }

/* ═══════════════════════════════════════════════════════════════
   ADMIN
═══════════════════════════════════════════════════════════════ */
.admin-sub { display: none; }
.admin-sub.active { display: block; }

.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.admin-toolbar h3 { font-size: 1.1rem; font-weight: 600; }

.admin-form {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .85rem;
}

.admin-list { display: flex; flex-direction: column; gap: .5rem; }

.admin-row {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .75rem 1rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}
.admin-row-main { flex: 1; min-width: 0; }
.admin-row-hebrew {
  font-family: var(--font-hebrew);
  font-size: 1.1rem;
  font-weight: 600;
  direction: rtl;
}
.admin-row-sub { font-size: .8rem; color: var(--text-3); }
.admin-row-actions { display: flex; gap: .5rem; flex-shrink: 0; }

.btn-delete {
  background: var(--error-dim);
  color: var(--error);
  border: 1px solid var(--error);
  border-radius: var(--radius);
  padding: .3rem .65rem;
  font-size: .78rem;
  cursor: pointer;
  transition: background var(--transition);
}
.btn-delete:hover { background: var(--error); color: #fff; }

.btn-edit {
  background: var(--bg-4);
  color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .3rem .65rem;
  font-size: .78rem;
  cursor: pointer;
  transition: background var(--transition);
}
.btn-edit:hover { background: var(--border); color: var(--text-1); }

/* Seed section */
.seed-status {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .75rem 1rem;
  font-size: .85rem;
  color: var(--text-2);
  margin-bottom: 1rem;
}
.seed-log {
  margin-top: 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  font-family: monospace;
  font-size: .8rem;
  color: var(--text-2);
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: .2rem;
}
.seed-log .log-ok   { color: var(--success); }
.seed-log .log-err  { color: var(--error); }
.seed-log .log-info { color: var(--text-3); }

/* Users list */
.user-row {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .85rem 1rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}
.user-email { flex: 1; font-size: .9rem; font-weight: 500; }
.user-meta  { font-size: .78rem; color: var(--text-3); }

/* ═══════════════════════════════════════════════════════════════
   TOAST
═══════════════════════════════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(1rem);
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .65rem 1.25rem;
  font-size: .875rem;
  color: var(--text-1);
  box-shadow: var(--shadow);
  z-index: 999;
  opacity: 0;
  transition: opacity .25s, transform .25s;
  white-space: nowrap;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.success { border-color: var(--success); color: var(--success); }
.toast.error   { border-color: var(--error);   color: var(--error); }

/* ═══════════════════════════════════════════════════════════════
   LOADING STATE
═══════════════════════════════════════════════════════════════ */
.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: var(--text-3);
  font-size: .9rem;
  gap: .5rem;
}
.spin { animation: spin 1s linear infinite; display: inline-block; }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE ADJUSTMENTS
═══════════════════════════════════════════════════════════════ */
@media (min-width: 600px) {
  .nav-tab { font-size: .8rem; padding: .4rem .9rem; }
  .fc-hebrew { font-size: 4rem; }
  .fc-face { padding: 2.5rem 2rem; }
  .words-table td, .words-table th { padding: .75rem 1rem; }
}

@media (min-width: 900px) {
  .section-inner { padding: 0 2rem 3rem; }
  .admin-form .field-row { flex-wrap: nowrap; }
}

/* ═══════════════════════════════════════════════════════════════
   ADMIN — toggle learned button + progress section
═══════════════════════════════════════════════════════════════ */
.btn-toggle-learned {
  font-size: .75rem;
  padding: .3rem .65rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  cursor: pointer;
  font-weight: 500;
  transition: background .2s, border-color .2s;
  white-space: nowrap;
}
.btn-learned {
  background: rgba(74, 222, 128, .15);
  border-color: var(--success);
  color: var(--success);
}
.btn-not-learned {
  background: transparent;
  border-color: var(--border);
  color: var(--text-2);
}
.btn-not-learned:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Progress tab */
.progress-stats {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.prog-stat-row {
  font-size: .9rem;
  color: var(--text-2);
}
.prog-stat-row strong { color: var(--text-1); }

.progress-actions {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.progress-action-block {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}
.progress-action-block h4 {
  font-size: .95rem;
  font-weight: 600;
  color: var(--text-1);
  margin: 0 0 .25rem;
}
.progress-action-block .section-hint { margin: 0 0 .75rem; }

.danger-zone { border-color: rgba(239, 68, 68, .4); }

.btn-danger {
  background: transparent;
  border: 1px solid var(--error);
  color: var(--error);
  border-radius: 8px;
  padding: .45rem 1rem;
  font-size: .8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .2s;
}
.btn-danger:hover { background: rgba(239, 68, 68, .1); }

/* ── Flashcard "New word" badge ─────────────────────────────── */
.badge-new-word {
  display: inline-block;
  padding: .2rem .55rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  background: rgba(251,191,36,.15);
  color: #f59e0b;
  border: 1px solid rgba(251,191,36,.35);
  margin-bottom: .5rem;
}

/* Allow 4-stat row to wrap gracefully on very small screens */
#flashcards-stats {
  flex-wrap: wrap;
}
