:root {
  color-scheme: light;
  --primary: #4255ff;
  --primary-dark: #2f3fd6;
  --primary-soft: #edefff;
  --bg: #f6f7fb;
  --bg-elev: #eef0f8;
  --card: #ffffff;
  --text: #282e3e;
  --muted: #586380;
  --border: #d9dde8;
  --ok: #18ae79;
  --ok-text: #0e7c55;
  --ok-soft: #e3f7ef;
  --bad: #ff725b;
  --bad-text: #d23f2b;
  --bad-soft: #ffeeea;
  --progress-bg: #e6e9f2;
  --shadow: 0 4px 16px rgba(40, 46, 62, 0.08);
  --shadow-lg: 0 10px 32px rgba(40, 46, 62, 0.14);
  --radius: 14px;
  --radius-sm: 10px;
  --surface: var(--card);
  --surface-2: var(--bg-elev);
  --text-muted: var(--muted);
  --danger: var(--bad);
  --danger-soft: var(--bad-soft);
  --warn: #d97706;
  --warn-soft: rgba(245, 158, 11, 0.16);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --primary: #6b7bff;
  --primary-dark: #5566ff;
  --primary-soft: rgba(107, 123, 255, 0.18);
  --bg: #0f1322;
  --bg-elev: #171c30;
  --card: #1b2138;
  --text: #eef1fb;
  --muted: #9aa4c4;
  --border: #2d3556;
  --ok: #25c990;
  --ok-text: #5ce4b2;
  --ok-soft: rgba(37, 201, 144, 0.16);
  --bad: #ff7a66;
  --bad-text: #ff9483;
  --bad-soft: rgba(255, 122, 102, 0.16);
  --progress-bg: #2a3150;
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 34px rgba(0, 0, 0, 0.5);
  --surface: var(--card);
  --surface-2: var(--bg-elev);
  --text-muted: var(--muted);
  --danger: var(--bad);
  --danger-soft: var(--bad-soft);
  --warn: #f59e0b;
  --warn-soft: rgba(245, 158, 11, 0.18);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  overflow-x: hidden;
  max-width: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--primary); text-decoration: none; }
h1 { font-size: 2rem; margin: 0.2em 0 0.3em; line-height: 1.2; }
h2 { font-size: 1.35rem; margin: 1.6em 0 0.8em; }
h3 { margin: 0.3em 0; }
button, input, select, textarea { font: inherit; color: inherit; }

.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 24px 20px 48px; flex: 1; }
.muted { color: var(--muted); margin: 0.2em 0; }
.small { font-size: 0.85rem; }
.center { text-align: center; }
.lead { font-size: 1.1rem; }
.hint { color: var(--muted); font-size: 0.85rem; margin-top: 18px; }

/* ---------- Fejléc ---------- */
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-inner {
  max-width: 1260px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.2rem; color: var(--primary); white-space: nowrap; }
.logo { font-size: 1.5rem; }
.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
  flex-shrink: 0;
}
.nav { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; flex: 1; }
.nav a,
.nav-dropdown-trigger {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.93rem;
  padding: 7px 12px;
  border-radius: 10px;
  transition: background 0.15s, color 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
}
.nav a:hover,
.nav-dropdown-trigger:hover { background: var(--bg); color: var(--text); }
.nav a.active,
.nav-dropdown.active .nav-dropdown-trigger { background: var(--primary-soft); color: var(--primary); }

.nav-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.nav-dropdown-caret {
  font-size: 0.75rem;
  opacity: 0.8;
  transition: transform 0.15s ease;
}
.nav-dropdown.open .nav-dropdown-caret {
  transform: rotate(180deg);
}
.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 220px;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 3px;
  z-index: 100;
}
.nav-dropdown.open .nav-dropdown-menu {
  display: flex;
}
.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--text) !important;
  font-weight: 600;
  font-size: 0.91rem;
  text-decoration: none;
  white-space: nowrap;
}
.nav-dropdown-item:hover {
  background: var(--bg-elev) !important;
  color: var(--primary) !important;
}
.nav-dropdown-item.active {
  background: var(--primary-soft) !important;
  color: var(--primary) !important;
}

.topbar-controls { display: flex; align-items: center; gap: 10px; }
.theme-btn {
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 10px;
  width: 36px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.05rem;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
.theme-btn:hover { border-color: var(--primary); background: var(--primary-soft); }
.theme-btn:active { transform: translateY(1px); }

.lang-switch { display: flex; background: var(--bg); border-radius: 10px; padding: 3px; border: 1px solid var(--border); }
.lang-btn {
  border: 0;
  background: transparent;
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--muted);
}
.lang-btn.active { background: var(--card); color: var(--text); box-shadow: var(--shadow); }

.footer { text-align: center; color: var(--muted); font-size: 0.85rem; padding: 20px; }

/* ---------- Gombok ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 9px 18px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.05s, box-shadow 0.15s;
  white-space: nowrap;
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn-sm { padding: 6px 12px; font-size: 0.875rem; }
.btn-lg { padding: 12px 24px; font-size: 1.05rem; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--primary-soft); color: var(--primary); }
.btn-secondary:hover { border-color: var(--primary); }
.btn-ghost { background: var(--card); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: var(--card); border-color: var(--border); color: var(--bad-text); }
.btn-danger:hover { border-color: var(--bad); background: var(--bad-soft); }
.btn-add {
  width: 100%;
  background: var(--card);
  border: 2px dashed var(--border);
  color: var(--primary);
  padding: 16px;
  margin-top: 4px;
}
.btn-add:hover { border-color: var(--primary); }

.icon-btn {
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
}
.icon-btn:hover { background: var(--bg); }
.btn-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.btn-row.left { justify-content: flex-start; }

/* ---------- Kezdőlap ---------- */
.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  background: linear-gradient(120deg, var(--primary) 0%, #7b5cff 100%);
  color: #fff;
  border-radius: 20px;
  padding: 28px 32px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-lg);
}
.hero p { margin: 0; opacity: 0.9; font-size: 1.1rem; }
.hero .btn-primary { background: #fff; color: var(--primary); }
.hero .btn-primary:hover { background: #f0f2ff; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.chip {
  border: 2px solid var(--border);
  background: var(--card);
  border-radius: 999px;
  padding: 6px 16px;
  cursor: pointer;
  font-weight: 600;
  color: var(--muted);
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.set-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  border-bottom: 4px solid transparent;
  transition: box-shadow 0.15s, border-color 0.15s, transform 0.15s;
}
.set-card:hover { box-shadow: var(--shadow-lg); border-bottom-color: var(--primary); transform: translateY(-2px); }
.set-card-main { color: inherit; padding: 18px 20px 10px; flex: 1; }
.set-card-main h3 { font-size: 1.2rem; margin-top: 10px; }
.set-card-actions { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 20px 18px; }
.desc { color: var(--muted); margin: 6px 0; overflow-wrap: anywhere; }

.badge {
  display: inline-block;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.8rem;
  border-radius: 999px;
  padding: 3px 10px;
}
.pill { display: inline-block; font-size: 0.8rem; font-weight: 700; border-radius: 999px; padding: 2px 10px; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }

.progress { background: var(--progress-bg); border-radius: 999px; height: 8px; overflow: hidden; flex: 1; }
.progress > div { background: var(--ok); height: 100%; border-radius: 999px; transition: width 0.3s; }
.progress.small { height: 7px; margin-top: 8px; flex: 0 0 7px; width: 100%; }
.progress.big { height: 12px; max-width: 420px; margin: 12px auto 24px; flex: 0 0 12px; width: 100%; }

.empty {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
  padding: 40px 24px;
  color: var(--muted);
  font-size: 1.05rem;
}
.empty.error { color: var(--bad-text); }
.loading { text-align: center; color: var(--muted); padding: 60px 0; }
.big-emoji { font-size: 3rem; }

/* ---------- Készlet oldal ---------- */
.back { display: inline-block; font-weight: 600; margin-bottom: 10px; }
.set-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.set-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 22px; }
.mode-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--text);
  border-bottom: 4px solid transparent;
  transition: box-shadow 0.15s, border-color 0.15s, transform 0.15s;
}
.mode-card:hover { border-bottom-color: var(--primary); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.mode-card strong { font-size: 1.1rem; }
.mode-icon { font-size: 1.8rem; }

.term-list { display: flex; flex-direction: column; gap: 10px; }
.term-row {
  background: var(--card);
  border-radius: 12px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
}
.term-cell, .def-cell { display: flex; align-items: center; justify-content: space-between; gap: 8px; overflow-wrap: anywhere; }
.term-cell { font-weight: 600; border-right: 2px solid var(--bg); padding-right: 16px; }
.status-cell { min-width: 70px; text-align: right; }
.meaning-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.meaning-tag {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px 10px;
  font-size: 0.95rem;
}

/* ---------- Szerkesztő ---------- */
.editor { display: flex; flex-direction: column; gap: 16px; }
.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; flex: 1; }
.field:last-child { margin-bottom: 0; }
.field-label { font-size: 0.78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.field input, .field textarea, .field select, .import textarea, .inline-field select {
  border: 0;
  border-bottom: 2px solid var(--border);
  background: transparent;
  padding: 8px 2px;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}
.field textarea, .import textarea { resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus, .import textarea:focus { border-bottom-color: var(--primary); }
.field select { cursor: pointer; }
.field select option, .inline-field select option { background: var(--card); color: var(--text); }
.lang-row { display: flex; align-items: flex-end; gap: 12px; }
.swap-btn { font-size: 1.4rem; margin-bottom: 8px; color: var(--primary); }

.import summary { cursor: pointer; font-weight: 700; }
.import textarea {
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9rem;
}
.import textarea:focus { border-color: var(--primary); }
.import-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.inline-field { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--muted); }
.inline-field select { width: auto; cursor: pointer; }

.card-rows { display: flex; flex-direction: column; gap: 12px; }
.card-row { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px 8px 22px;
  border-bottom: 2px solid var(--bg);
}
.row-num { font-weight: 700; color: var(--muted); }
.row-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 14px 22px 18px; align-items: start; }
.row-fields .field { margin: 0; }
.meanings-col { display: flex; flex-direction: column; gap: 6px; }
.meaning-inputs { display: flex; flex-direction: column; gap: 6px; }
.meaning-line { display: flex; align-items: center; gap: 6px; }
.meaning-line input { flex: 1; }
.remove-meaning { font-size: 0.85rem; color: var(--muted); padding: 4px 6px; }
.remove-meaning:hover { color: var(--bad-text); }
.meaning-footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.link-btn {
  border: 0;
  background: transparent;
  color: var(--primary);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 2px 6px;
  border-radius: 6px;
  cursor: pointer;
}
.link-btn:hover { background: var(--primary-soft); }
.editor-footer { display: flex; justify-content: flex-end; gap: 10px; position: sticky; bottom: 0; padding: 14px 0; background: linear-gradient(transparent, var(--bg) 35%); }

/* ---------- Tanulás ---------- */
.study { max-width: 800px; margin: 0 auto; }
.study-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.study-top .back { margin: 0; }
.study-mode { font-weight: 700; color: var(--muted); }
.study-options { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 6px; }
.toggle {
  border: 2px solid var(--border);
  background: var(--card);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--muted);
}
.toggle:hover { border-color: var(--primary); }
.toggle.active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }

.study-progress { display: flex; align-items: center; gap: 14px; margin: 14px 0; font-weight: 700; color: var(--muted); }
.study-progress > span { min-width: 64px; }

.flashcard-scene { perspective: 1600px; }
.flashcard {
  position: relative;
  height: 380px;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.4, 0.2, 0.2, 1);
  outline: none;
}
.flashcard.flipped { transform: rotateY(180deg); }
.face {
  position: absolute;
  inset: 0;
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  padding: 18px 24px;
}
.face.back { transform: rotateY(180deg); }
.flashcard:focus-visible .face { box-shadow: 0 0 0 3px var(--primary), var(--shadow-lg); }
.face-top { display: flex; align-items: center; gap: 8px; }
.face-top .speak { margin-left: auto; font-size: 1.3rem; }
.face-lang { font-size: 0.8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.face-text {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 2.4rem;
  font-weight: 500;
  overflow-wrap: anywhere;
  overflow: auto;
  padding: 10px;
}
.face-text.long, .question-text.long { font-size: 1.6rem; }
.face-text.xlong, .question-text.xlong { font-size: 1.15rem; }

.fc-controls { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
.round-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--card);
  font-size: 1.3rem;
  cursor: pointer;
}
.round-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.round-btn:disabled { opacity: 0.4; cursor: default; }
.btn-learning { background: var(--card); border-color: var(--bad); color: var(--bad-text); min-width: 150px; }
.btn-learning:hover { background: var(--bad-soft); }
.btn-know { background: var(--card); border-color: var(--ok); color: var(--ok); min-width: 150px; }
.btn-know:hover { background: var(--ok-soft); }

.done-card { background: var(--card); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 32px 28px; text-align: center; margin-top: 14px; }
.mistakes { display: flex; flex-direction: column; gap: 8px; text-align: left; margin-top: 10px; }
.mistake { border: 2px solid var(--bg); border-radius: 10px; padding: 10px 14px; }
.m-prompt { font-weight: 700; }
.m-answer { color: var(--ok); }
.m-given { color: var(--bad-text); text-decoration: line-through; }

.question-card { background: var(--card); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 20px 26px 24px; }
.question-text { font-size: 2rem; font-weight: 500; text-align: center; padding: 28px 10px; overflow-wrap: anywhere; }
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.option {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  border: 2px solid var(--border);
  background: var(--card);
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.option:hover:not(:disabled) { border-color: var(--primary); }
.option:disabled { cursor: default; }
.option.correct { border-color: var(--ok); background: var(--ok-soft); color: var(--ok-text); }
.option.wrong { border-color: var(--bad); background: var(--bad-soft); color: var(--bad-text); }
.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--muted);
  font-size: 0.85rem;
  flex-shrink: 0;
}
.feedback { margin-top: 14px; }
.fb-ok { color: var(--ok); font-weight: 700; font-size: 1.1rem; margin: 0; }
.fb-bad { color: var(--bad-text); font-weight: 600; margin: 0 0 10px; }
.fb-bad strong { color: var(--text); }
.question-card .field input { font-size: 1.3rem; }
.field input.is-correct { border-bottom-color: var(--ok); background: var(--ok-soft); }
.field input.is-wrong { border-bottom-color: var(--bad); background: var(--bad-soft); }

/* ---------- Értesítés ---------- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #282e3e;
  color: #fff;
  padding: 12px 22px;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  font-weight: 600;
  z-index: 100;
  max-width: calc(100% - 40px);
}
.toast.success { background: var(--ok); }
.toast.error { background: #d23f2b; }

/* ---------- Nyelvválasztó főoldal, Csoportok, Érdemjegyek, Időmérő és Statisztikák ---------- */
.brand-text { display: inline-flex; align-items: baseline; gap: 6px; }
.brand-sub { font-weight: 600; opacity: 0.9; }

.hero-sub { font-size: 0.92rem !important; opacity: 0.85; margin-top: 6px !important; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hero .btn-secondary { background: rgba(255, 255, 255, 0.18); color: #fff; border-color: rgba(255, 255, 255, 0.45); }
.hero .btn-secondary:hover { background: rgba(255, 255, 255, 0.28); border-color: #fff; }
.hero .btn-ghost { background: rgba(255, 255, 255, 0.15); color: #fff; border-color: rgba(255, 255, 255, 0.4); }
.hero .btn-ghost:hover { background: rgba(255, 255, 255, 0.28); color: #fff; border-color: #fff; }

.lang-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}
.lang-card {
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 22px 24px;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 2px solid transparent;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.lang-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}
.lang-card-top { display: flex; align-items: center; gap: 16px; }
.lang-card-top > div { flex: 1; }
.lang-card-top h2 { margin: 0 0 2px; font-size: 1.5rem; }
.lang-flag { font-size: 2.8rem; line-height: 1; }
.lang-card-foot { display: flex; justify-content: space-between; align-items: center; }
.lang-open { font-weight: 700; color: var(--primary); }

.card-badges { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.badge.small { font-size: 0.75rem; padding: 2px 8px; }
.group-card { border-left: 4px solid var(--primary); }

/* Érdemjegy jelvények (1–5) */
.grade-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  font-size: 0.8rem;
  border-radius: 999px;
  padding: 3px 10px;
}
.grade-badge.g5 { background: var(--ok-soft); color: var(--ok-text); }
.grade-badge.g4 { background: rgba(59, 130, 246, 0.16); color: #3b82f6; }
.grade-badge.g3 { background: rgba(245, 158, 11, 0.18); color: #d97706; }
.grade-badge.g2 { background: rgba(249, 115, 22, 0.18); color: #ea580c; }
.grade-badge.g1 { background: var(--bad-soft); color: var(--bad-text); }
.grade-badge.big-grade { font-size: 1rem; padding: 6px 16px; }

.result-badges {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 10px 0 8px;
}
.time-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  font-weight: 600;
  font-size: 0.92rem;
}

/* Csoport vegyes összefoglaló és egyéni szóválasztó */
.mixed-panel { margin-top: 20px; border: 2px solid var(--primary-soft); }
.mixed-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}
.mixed-header h2 { margin: 0 0 4px; }
.disabled-link { pointer-events: none; opacity: 0.45; }

.word-picker {
  margin-top: 18px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}
.word-picker summary { cursor: pointer; font-weight: 700; color: var(--primary); }
.picker-toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.picker-sections { display: flex; flex-direction: column; gap: 14px; max-height: 420px; overflow: auto; padding-right: 4px; }
.picker-set { background: var(--bg); border-radius: 12px; padding: 12px 14px; }
.picker-set-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.picker-words {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}
.word-check {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 0.9rem;
}
.word-check.checked { border-color: var(--primary); }
.wc-term { font-weight: 600; }
.wc-def { font-size: 0.82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.assign-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.assign-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 10px;
  cursor: pointer;
}

/* Tanulás fejléc, időmérő és 3-állású irányválasztó */
.study-top-right { display: flex; align-items: center; gap: 12px; }
.timer-pill {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
}
.study-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 14px 0 6px;
}
.study-toolbar .study-options { margin: 0; }
.dir-switch { display: flex; gap: 6px; flex-wrap: wrap; }

/* Statisztikák oldal */
.stats-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
}
.stat-kpi {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.kpi-value { font-size: 1.9rem; font-weight: 800; line-height: 1.15; }

.stats-table {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.stats-head, .stats-row {
  display: grid;
  grid-template-columns: 2fr 0.8fr 0.9fr 1.3fr 1.3fr 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
}
.stats-head {
  background: var(--bg-elev);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.stats-row {
  color: var(--text);
  border-top: 1px solid var(--border);
  transition: background 0.15s;
}
.stats-row:hover { background: var(--bg); }

/* Szavak / Kifejezések gyakorló blokkok */
.practice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 20px;
}
.practice-block {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.practice-block.highlight { border-color: var(--primary-soft); }
.practice-block.disabled-block { opacity: 0.55; }
.practice-block-head { font-size: 1.05rem; }
.practice-btns { display: flex; gap: 8px; flex-wrap: wrap; }

.import-selects { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }

/* Kitöltési előzmények (History) */
.history-section { margin-top: 32px; }
.small-empty { padding: 24px 18px; }
.history-list { display: flex; flex-direction: column; gap: 10px; }
.history-item {
  background: var(--card);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 14px 18px;
  border-left: 4px solid var(--primary);
}
.history-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.attempt-pill {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 800;
  font-size: 0.82rem;
  border-radius: 999px;
  padding: 3px 10px;
}
.history-target { color: var(--text); }
.history-target:hover { color: var(--primary); }
.history-points { font-weight: 700; }
.history-time { font-variant-numeric: tabular-nums; font-weight: 600; }
.history-details { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 10px; }
.history-details summary { cursor: pointer; font-weight: 600; font-size: 0.88rem; color: var(--primary); }
.mistakes.compact { margin-top: 8px; gap: 6px; }
.mistake.ok-row { opacity: 0.8; }

/* ---------- Mobil ---------- */
@media (max-width: 720px) {
  .topbar-inner { gap: 10px; flex-wrap: wrap; padding: 8px 14px; }
  .brand-sub { display: none; }
  .nav a { padding: 6px 10px; font-size: 0.95rem; }
  .container { padding: 16px 14px 40px; }
  h1 { font-size: 1.6rem; }
  .hero { padding: 22px; }
  .lang-grid { grid-template-columns: 1fr; }
  .term-row { grid-template-columns: 1fr; gap: 6px; }
  .term-cell { border-right: 0; padding-right: 0; }
  .status-cell { text-align: left; }
  .row-fields { grid-template-columns: 1fr; gap: 14px; }
  .flashcard { height: 300px; }
  .face-text { font-size: 1.8rem; }
  .options { grid-template-columns: 1fr; }
  .question-text { font-size: 1.6rem; padding: 18px 6px; }
  .btn-learning, .btn-know { min-width: 0; flex: 1; }
  .stats-head { display: none; }
  .stats-row { grid-template-columns: 1fr 1fr; gap: 6px; padding: 14px; }
}

/* ---------- AI Beszélgetőpartner (Írásbeli üzenőfal és Mikrofonos szóbeli mód) ---------- */
.ai-hub-card {
  border: 2px solid var(--primary-soft);
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.ai-hub-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.ai-hub-main h2 { margin: 0 0 4px; }
.ai-hub-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.ai-topic-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.ai-topic-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.88rem;
  font-weight: 600;
}

.ai-study { max-width: 1060px; }
.ai-controls-panel {
  margin-top: 14px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ai-study {
  max-width: 1120px;
}
.ai-study .study-top {
  margin-bottom: 8px;
}
.ai-controls-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 14px;
  margin-bottom: 10px;
}
.ai-ctrl-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.ai-ctrl-row.voice-bar {
  border-top: 1px solid var(--border);
  padding-top: 8px;
  justify-content: flex-start;
}
.ai-ctrl-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.voice-sel-wrap select { max-width: 290px; font-weight: 600; padding: 5px 10px; }

.ai-layout {
  display: grid;
  grid-template-columns: 1fr 290px;
  gap: 14px;
  margin-top: 8px;
  margin-bottom: 18px;
  height: calc(100vh - 280px);
  min-height: 440px;
  max-height: 660px;
  align-items: stretch;
}
.ai-study.voice-mode .ai-layout {
  height: auto;
  min-height: 0;
  max-height: none;
  align-items: start;
}
.ai-study.voice-mode .ai-chat-col {
  height: auto;
  overflow: visible;
}
.ai-study.voice-mode .ai-sidebar {
  height: 540px;
  max-height: 540px;
}
.ai-chat-col {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--border);
}
.ai-messages {
  padding: 14px 16px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg);
}
.chat-msg {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  max-width: 88%;
}
.chat-msg.user-msg {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.chat-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.chat-bubble {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 14px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.user-msg .chat-bubble {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.user-msg .chat-bubble .icon-btn { color: #fff; }
.user-msg .pill.ok {
  background: rgba(255, 255, 255, 0.24);
  color: #fff;
}
.chat-msg.asked-back .chat-bubble {
  border-color: #f59e0b;
  border-width: 2px;
}
.chat-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.8rem;
}
.chat-msg-tools { display: inline-flex; align-items: center; gap: 4px; }
.chat-text { font-size: 0.98rem; line-height: 1.42; overflow-wrap: anywhere; }
.chat-translation {
  font-size: 0.86rem;
  color: var(--text-muted);
  border-top: 1px dashed var(--border);
  padding-top: 5px;
  margin-top: 2px;
}
.chat-feedback {
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 8px;
  padding: 5px 10px;
  margin-top: 2px;
}
.chat-feedback.praise { background: var(--ok-soft); color: var(--ok); }
.chat-feedback.correction, .chat-feedback.tip, .chat-feedback.clarify {
  background: rgba(245, 158, 11, 0.16);
  color: #d97706;
}
.used-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 3px; }

.ai-helper-bar {
  padding: 7px 12px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}
.ai-target-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.86rem;
}
.ai-target-left, .ai-target-right {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.target-label-short {
  font-weight: 700;
  color: var(--text-muted);
}
.target-word-chip {
  border: 1px solid var(--primary);
  background: var(--primary-soft);
  color: var(--text);
  border-radius: 999px;
  padding: 3px 11px;
  font-size: 0.86rem;
  cursor: pointer;
}
.ai-starters {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 4px;
  border-top: 1px dashed var(--border);
}
.starter-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.starter-chip {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.starter-chip:hover { border-color: var(--primary); background: var(--primary-soft); }

.ai-input-panel {
  padding: 9px 12px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}
.voice-stage {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 2px 0;
}
.mic-hero-btn {
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  padding: 8px 20px;
  font-size: 0.95rem;
  box-shadow: var(--shadow);
}
.mic-hero-btn.listening, .mic-inline-btn.listening {
  background: var(--danger) !important;
  color: #fff !important;
  animation: pulseMic 1.2s infinite;
}
@keyframes pulseMic {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
.ai-input-row { display: flex; gap: 8px; align-items: center; }
.ai-input-row input {
  flex: 1;
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  background: var(--bg);
  color: var(--text);
  outline: none;
}
.ai-input-row input:focus { border-color: var(--primary); }

.ai-sidebar {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.ai-words-panel {
  padding: 12px 14px;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.ai-words-panel h3 { margin: 0 0 6px; font-size: 0.95rem; }
.ai-word-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin-top: 8px;
  padding-right: 4px;
}
.ai-word-item {
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 10px;
  padding: 7px 10px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.ai-word-item:hover { border-color: var(--primary); }
.ai-word-item.used { border-color: var(--ok); background: var(--ok-soft); }
.ai-word-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.ai-word-btns { display: inline-flex; align-items: center; gap: 4px; }

@media (max-width: 820px) {
  .ai-layout {
    grid-template-columns: 1fr;
    height: auto;
    max-height: none;
  }
  .ai-chat-col { height: 540px; }
  .ai-words-panel { max-height: 320px; }
}

/* --- Átlátható, kategóriás Gyakorlóközpont és Szekció-módok --- */
.practice-launcher {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.practice-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.practice-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}
.practice-cat-card {
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.practice-cat-title {
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}

.set-modes-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}
.mode-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.modes-compact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.mode-card-compact {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  transition: transform 0.12s, border-color 0.15s, background 0.15s;
}
.mode-card-compact:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  transform: translateY(-1px);
}
.mode-icon-sm {
  font-size: 1.65rem;
  line-height: 1;
  flex-shrink: 0;
}
.mode-card-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.mode-card-body strong {
  font-size: 0.96rem;
}
.mode-card-body .muted.small {
  line-height: 1.25;
}

/* --- Emoji ikonok, Csak hallgatás (Podcast), Szókirakó és Képes Memória --- */
.card-emoji {
  font-size: 1.35rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.face-emoji {
  font-size: 2.6rem;
  line-height: 1;
  margin-bottom: -6px;
}

.listen-card {
  text-align: center;
  align-items: center;
  padding: 36px 28px;
}
.listen-emoji {
  font-size: 3.4rem;
  line-height: 1;
}
.listen-status-pill {
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.9rem;
}
.listen-status-pill.wait {
  background: var(--warn-soft);
  color: var(--warn);
}
.listen-status-pill.def {
  background: var(--ok-soft);
  color: var(--ok);
}
.listen-answer {
  font-size: 1.45rem;
  font-weight: 700;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px dashed var(--border);
  min-width: 240px;
}
.listen-answer.masked {
  color: var(--text-muted);
  letter-spacing: 4px;
}
.listen-answer.visible {
  color: var(--ok);
  border-style: solid;
  border-color: var(--ok);
  background: var(--ok-soft);
}

.puzzle-slots {
  min-height: 64px;
  padding: 12px;
  border: 2px dashed var(--primary);
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.puzzle-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 0;
}
.puzzle-tile {
  padding: 10px 16px;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.1s, border-color 0.15s, background 0.15s;
}
.puzzle-tile:hover:not(:disabled) {
  border-color: var(--primary);
  transform: translateY(-1px);
}
.puzzle-tile.picked {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.memory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.memory-tile {
  min-height: 118px;
  padding: 14px 12px;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.12s, border-color 0.15s, background 0.15s;
}
.memory-tile:hover:not(:disabled) {
  border-color: var(--primary);
  transform: translateY(-2px);
}
.memory-tile.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.memory-tile.matched {
  border-color: var(--ok);
  background: var(--ok-soft);
  opacity: 0.72;
  cursor: default;
}
.memory-tile.wrong {
  border-color: var(--danger);
  background: var(--danger-soft);
}
.memory-emoji {
  font-size: 1.9rem;
  line-height: 1;
}
.memory-text {
  font-weight: 700;
  font-size: 0.98rem;
  text-align: center;
  word-break: break-word;
}
.memory-lang {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
}

/* =========================================================================
   AI NYELVVIZSGA FOLYAMAT SÁV ÉS KOMPLEX NYELVVIZSGA (B2 / C1) MODUL
   ========================================================================= */
.ai-fixed-mode-badge {
  font-size: 0.85rem;
  padding: 6px 12px;
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid var(--primary);
}
.ai-exam-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
}
.exam-phase-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.exam-step-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.exam-step-pill span {
  display: none;
}
.exam-step-pill.active {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: var(--primary);
}
.exam-step-pill.done {
  background: var(--ok-soft);
  color: var(--ok);
  border-color: var(--ok);
}
.exam-live-score {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
}

.exam-promo-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  border: 2px solid var(--primary);
  background: linear-gradient(135deg, var(--primary-soft), var(--surface));
}
.exam-promo-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 260px;
}
.exam-promo-icon {
  font-size: 2.3rem;
  line-height: 1;
}
.exam-promo-left h3 {
  margin: 0 0 4px;
  font-size: 1.08rem;
}
.exam-promo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.exam-stepper {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.exam-step-btn {
  padding: 8px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}
.exam-step-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.exam-step-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.exam-level-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 16px;
  margin-top: 14px;
}
.exam-level-card {
  padding: 18px;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.12s;
}
.exam-level-card.active {
  border-color: var(--primary);
  box-shadow: var(--shadow);
}
.exam-level-card.prepared {
  opacity: 0.88;
}
.exam-level-card .btn {
  white-space: normal;
  width: 100%;
  max-width: 100%;
  text-align: center;
  line-height: 1.35;
  padding: 12px 16px;
  margin-top: auto;
}
.exam-weights-list {
  margin: 4px 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
}
.exam-c1-notice {
  margin-top: auto;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px dashed var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.exam-module-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.exam-module-head h2 {
  margin: 6px 0 4px;
}
.exam-q-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.exam-q-card {
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.exam-opt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin-top: 4px;
}
.exam-opt-btn {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
}
.exam-opt-btn:hover {
  border-color: var(--primary);
}
.exam-opt-btn.selected {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.exam-listen-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.exam-prompt-box {
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border-left: 3px solid var(--primary);
  font-size: 0.92rem;
  line-height: 1.45;
}
.exam-keywords-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.exam-kw-chip {
  cursor: pointer;
  border: 1px solid var(--primary);
}
.exam-oral-messages {
  max-height: 300px;
  min-height: 180px;
}
.exam-module-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.exam-cert-header {
  text-align: center;
  margin-bottom: 18px;
}
.exam-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}
.exam-mod-score-card {
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.exam-mod-score-card h3 {
  margin: 4px 0 0;
  font-size: 0.96rem;
}

/* =========================================================================
   SZÓBELI AI STÚDIÓ ÉS LENYITHATÓ CHAT-NAPLÓ
   ========================================================================= */
.voice-studio-panel {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border: 2px solid var(--primary);
  background: linear-gradient(145deg, var(--surface), var(--surface-2));
}
.voice-studio-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.voice-examiner-box {
  display: flex;
  align-items: center;
  gap: 12px;
}
.voice-avatar-big {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--primary-soft);
  border: 2px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  transition: transform 0.2s, box-shadow 0.2s;
}
.voice-avatar-big.speaking {
  transform: scale(1.07);
  box-shadow: 0 0 0 6px var(--primary-soft);
}
.voice-examiner-name {
  margin-bottom: 4px;
  font-size: 1rem;
}
.voice-status-pill.listening {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: var(--danger);
  font-weight: 700;
}
.voice-status-pill.speaking {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: var(--primary);
  font-weight: 700;
}
.voice-flow-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.voice-start-hero {
  padding: 16px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px dashed var(--primary);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.voice-start-btn {
  min-width: 260px;
  font-size: 1.05rem;
}
.voice-live-exchange {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.voice-last-ai {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border-left: 4px solid var(--primary);
}
.voice-last-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.voice-last-text {
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.45;
}
.voice-heard-box {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1.5px dashed var(--border);
  font-size: 0.95rem;
  min-height: 46px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 8px;
}
.voice-heard-box.active {
  border-color: var(--danger);
  background: var(--danger-soft);
}
.mic-meter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.mic-meter-bar {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: var(--progress-bg);
  overflow: hidden;
}
.mic-meter-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: var(--ok);
  transition: width 0.08s linear;
}
.voice-action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.voice-action-row .btn, .voice-start-btn {
  white-space: normal;
  max-width: 100%;
  text-align: center;
  line-height: 1.3;
}
.voice-chat-drawer {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: hidden;
}
.voice-chat-drawer > summary {
  padding: 10px 14px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  background: var(--surface-2);
  color: var(--text);
  user-select: none;
}
.voice-chat-drawer > summary:hover {
  color: var(--primary);
}
.voice-chat-drawer .ai-messages {
  max-height: 280px;
  min-height: 140px;
  border: none;
  border-top: 1px solid var(--border);
  border-radius: 0;
}

/* =========================================================================
   FIXEN BEÉPÍTETT NYELVTAN AKADÉMIA ÉS HALLÁSÉRTÉS STÚDIÓ
   ========================================================================= */
.fixed-pillars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}
.fixed-pillar-card {
  border: 2px solid var(--primary);
  background: linear-gradient(155deg, var(--surface), var(--surface-2));
}
.fixed-pillar-card.listening-pillar {
  border-color: var(--ok);
}

.grammar-shell, .listening-shell {
  max-width: 1020px;
}
.grammar-hero-panel {
  margin-top: 12px;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.grammar-hero-panel h1 {
  margin: 6px 0 4px;
  font-size: 1.65rem;
}

.grammar-chapter-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  margin-top: 4px;
}
.grammar-ch-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.grammar-ch-pill:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}
.grammar-ch-pill.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: var(--shadow);
}
.grammar-ch-pill.done {
  border-left: 4px solid var(--ok);
}
.grammar-ch-pill.mix-pill {
  border-style: dashed;
  border-color: var(--primary);
}
.grammar-ch-pill .ch-icon {
  font-size: 1.45rem;
  line-height: 1;
  flex-shrink: 0;
}
.grammar-ch-pill .ch-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.grammar-ch-pill .ch-text strong {
  font-size: 0.86rem;
  line-height: 1.25;
}
.grammar-ch-pill .ch-text small {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.grammar-mode-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.grammar-theory-card {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.grammar-theory-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.grammar-theory-head h2 {
  margin: 8px 0 4px;
}
.grammar-golden-rule {
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  border-left: 4px solid var(--primary);
  font-size: 0.96rem;
  line-height: 1.5;
}
.grammar-formula-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}
.grammar-formula-box {
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gf-label {
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--primary);
}
.gf-pattern code {
  display: block;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px dashed var(--border);
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.4;
}
.gf-en {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.93rem;
}

.grammar-mistakes-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.grammar-mistake-card {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.gm-compare {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.gm-wrong {
  color: var(--bad-text);
  font-weight: 600;
}
.gm-wrong span {
  text-decoration: line-through;
}
.gm-right {
  color: var(--ok);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.gm-why {
  font-size: 0.87rem;
  color: var(--text-muted);
  border-top: 1px dashed var(--border);
  padding-top: 6px;
}

.grammar-examples-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.grammar-example-row {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.grammar-theory-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.grammar-play-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.grammar-rule-hint {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border-left: 3px solid var(--primary);
  font-size: 0.9rem;
}
.error-hunt-wrong-box {
  padding: 16px;
  border-radius: var(--radius-sm);
  background: var(--bad-soft);
  border: 2px dashed var(--bad);
  color: var(--bad-text);
  font-size: 1.2rem;
  text-align: center;
}
.grammar-explain-box {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.grammar-explain-box.ok {
  border-color: var(--ok);
  background: var(--ok-soft);
}
.grammar-explain-box.bad {
  border-color: var(--bad);
  background: var(--bad-soft);
}
.ge-title {
  font-weight: 800;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.ge-full {
  font-size: 0.98rem;
}
.ge-rule {
  font-size: 0.9rem;
  line-height: 1.45;
  padding-top: 4px;
  border-top: 1px dashed var(--border);
}

/* --- Hallásértés Stúdió --- */
.listening-audio-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.listening-player-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary-soft), var(--surface-2));
  border: 1.5px solid var(--primary);
}
.lp-speaker {
  display: flex;
  align-items: center;
  gap: 12px;
}
.lp-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.trainer-steps-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.trainer-reveal-card {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px dashed var(--border);
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.trainer-reveal-card.revealed {
  border-style: solid;
  border-color: var(--primary);
  background: var(--surface);
}
.tr-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.tr-sentence {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.45;
}
.tr-hu {
  font-size: 1.08rem;
  color: var(--ok);
  font-weight: 600;
}
.gapfill-sentence-box {
  padding: 18px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.75;
  text-align: center;
}
.gap-slot {
  display: inline-block;
  padding: 2px 12px;
  margin: 0 4px;
  border-radius: 8px;
  border: 2px dashed var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 800;
}
.gap-slot.filled {
  border-style: solid;
  cursor: pointer;
}
.gap-slot.filled.ok {
  border-color: var(--ok);
  background: var(--ok-soft);
  color: var(--ok);
}
.gap-slot.filled.bad {
  border-color: var(--bad);
  background: var(--bad-soft);
  color: var(--bad-text);
}

/* =========================================================================
   LEVÉLÍRÁS ÉS FOGALMAZÁS MŰHELY (4 SZEMPONTOS AI HIBAJAVÍTÓVAL)
   ========================================================================= */
.writing-shell {
  max-width: 1040px;
}
.fixed-pillar-card.writing-pillar {
  border-color: #f59e0b;
}
.writing-cat-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.writing-workspace-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.writing-task-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.writing-task-header h2 {
  margin: 8px 0 0;
}
.writing-situation-box {
  font-size: 0.98rem;
  line-height: 1.55;
  padding: 13px 16px;
}
.writing-points-box h3 {
  margin: 0 0 10px;
  font-size: 0.98rem;
}
.writing-points-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.writing-point-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface-2);
}
.writing-point-item.covered {
  border-color: var(--ok);
  background: var(--ok-soft);
}
.writing-point-item.missing {
  border-color: var(--warn);
  background: var(--warn-soft);
}
.wp-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 240px;
  font-size: 0.92rem;
}
.wp-status {
  font-size: 1.15rem;
  flex-shrink: 0;
}
.writing-phrases-drawer {
  margin-top: 2px;
}
.writing-phrases-grid {
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px;
}
.writing-phrase-chip {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: border-color 0.15s, background 0.15s;
}
.writing-phrase-chip:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.writing-sample-card, .writing-corrected-card {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--primary);
  background: var(--surface-2);
}
.writing-corrected-card {
  border-color: var(--ok);
}
.writing-sample-pre {
  margin: 8px 0 0;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: 0.96rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.writing-editor-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.writing-editor-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.writing-big-textarea {
  width: 100%;
  min-height: 290px;
  padding: 16px 18px;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 1.04rem;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.writing-big-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
}
.writing-action-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
}
.writing-eval-report {
  margin-top: 10px;
  padding-top: 18px;
  border-top: 2px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.writing-eval-header h2 {
  margin: 8px 0 4px;
}
.writing-4skills-grid, .writing-four-skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.writing-issues-section h3 {
  margin: 0 0 10px;
}

.fixed-pillar-card.reading-pillar {
  border-color: #10b981;
}
.fixed-pillar-card.mediation-pillar {
  border-color: #8b5cf6;
}
.fixed-pillar-card.pictures-pillar {
  border-color: #ec4899;
}

.writing-workspace-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 960px) {
  .writing-workspace-grid {
    grid-template-columns: 1fr;
  }
}
.writing-brief-panel, .writing-editor-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.writing-points-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.wp-check {
  font-weight: 800;
  color: var(--primary);
  min-width: 24px;
}
.wp-body {
  flex: 1;
  min-width: 200px;
}
.wp-tip {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.writing-phrases-box {
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.writing-phrases-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.writing-editor-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.writing-editor-top h3 {
  margin: 0 0 4px;
}
.writing-counter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.writing-editor-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.writing-report-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.writing-score-circle {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 4px solid var(--primary);
  background: var(--bg);
  flex-shrink: 0;
}
.writing-score-circle.ok {
  border-color: var(--ok);
}
.writing-score-circle.warn {
  border-color: var(--warn);
}
.wsc-num {
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1.1;
}
.wsc-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
}
.writing-report-summary {
  flex: 1;
  min-width: 240px;
}
.writing-report-summary h2 {
  margin: 6px 0 4px;
}
.writing-skill-card {
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.writing-skill-card h3 {
  margin: 4px 0 0;
  font-size: 1rem;
}
.wsk-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* =========================================================================
   11. OLVASOTT SZÖVEG ÉRTÉSE MŰHELY (#/lang/:code/reading)
   ========================================================================= */
.reading-workspace-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 16px;
  align-items: start;
  margin-top: 14px;
}
@media (max-width: 960px) {
  .reading-workspace-grid {
    grid-template-columns: 1fr;
  }
}
.reading-paragraphs-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}
.reading-para-card {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface-2);
}
.reading-para-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.reading-para-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.85rem;
}
.reading-para-text {
  margin: 0;
  line-height: 1.65;
  font-size: 0.98rem;
}
.reading-para-tr {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}
.reading-gap-badge {
  display: inline-block;
  padding: 2px 9px;
  margin: 0 3px;
  border-radius: 6px;
  border: 1.5px dashed var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.9rem;
}
.reading-gap-badge.filled {
  border-style: solid;
}
.reading-gap-badge.ok {
  border-style: solid;
  border-color: var(--ok);
  background: var(--ok-soft);
  color: var(--ok);
}
.reading-gap-badge.bad {
  border-style: solid;
  border-color: var(--bad);
  background: var(--bad-soft);
  color: var(--bad-text);
}
.reading-inline-gap-filled {
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--primary);
}
.reading-task-header h3 {
  margin: 6px 0 4px;
}
.reading-questions-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}
.reading-q-box {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.reading-q-box.ok {
  border-color: var(--ok);
  background: var(--ok-soft);
}
.reading-q-box.bad {
  border-color: var(--bad);
  background: var(--bad-soft);
}
.reading-q-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.reading-select {
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.93rem;
}
.reading-tf-btns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}
.reading-proof-box {
  margin-top: 4px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 0.88rem;
  line-height: 1.45;
}

/* =========================================================================
   12. KÖZVETÍTÉS ÉS SZÖVEGTÖMÖRÍTÉS MŰHELY (#/lang/:code/mediation)
   ========================================================================= */
.mediation-source-box {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--primary);
  background: var(--surface-2);
}
.mediation-source-title {
  font-weight: 800;
  font-size: 1.04rem;
  margin: 8px 0 6px;
  color: var(--primary);
}
.mediation-source-body {
  margin: 0;
  line-height: 1.62;
  font-size: 0.96rem;
}

/* =========================================================================
   13. KÉPLEÍRÁS ÉS KÉP-ÖSSZEHASONLÍTÁS MŰHELY (#/lang/:code/pictures)
   ========================================================================= */
.picture-comparison-panel {
  margin-top: 14px;
}
.picture-examiner-prompt {
  margin: 10px 0 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border-left: 4px solid var(--primary);
}
.picture-comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}
.picture-scene-card {
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: var(--surface-2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.picture-scene-art {
  padding: 18px 16px;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  position: relative;
}
.picture-tag-pill {
  align-self: flex-start;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}
.picture-emoji-stage {
  font-size: 2.75rem;
  letter-spacing: 0.12em;
  padding: 8px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(4px);
}
.picture-art-titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.picture-art-titles strong {
  font-size: 1.08rem;
}
.picture-art-titles span {
  font-size: 0.86rem;
  opacity: 0.92;
}
.picture-scene-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.picture-details-list {
  margin: 0;
  padding-left: 18px;
  font-size: 0.9rem;
  line-height: 1.5;
}
.picture-vocab-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.picture-mic-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px dashed var(--primary);
  background: var(--primary-soft);
}

/* =========================================================================
   14. FELHASZNÁLÓI RENDSZER (REGISZTRÁCIÓ, BEJELENTKEZÉS, RANGRENDSZER)
   ========================================================================= */
.nav a {
  white-space: nowrap;
}
.auth-bar {
  display: flex;
  align-items: center;
}
.auth-user-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 4px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.auth-username {
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
}
.auth-logout-btn {
  padding: 4px 10px;
  font-size: 0.82rem;
  white-space: nowrap;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  white-space: nowrap;
}
.role-badge.role-user {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
}
.role-badge.role-vip {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.22), rgba(217, 119, 6, 0.3));
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.55);
}
[data-theme="light"] .role-badge.role-vip {
  color: #b45309;
}
.role-badge.role-admin {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(37, 99, 235, 0.28));
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.5);
}
[data-theme="light"] .role-badge.role-admin {
  color: #1d4ed8;
}
.role-badge.role-super {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.24), rgba(236, 72, 153, 0.28));
  color: #e879f9;
  border-color: rgba(168, 85, 247, 0.55);
}
[data-theme="light"] .role-badge.role-super {
  color: #7e22ce;
}

.auth-page-wrap {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px 0 44px;
}
.auth-card {
  width: 100%;
  max-width: 520px;
  padding: 26px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.auth-top-back {
  margin-bottom: -4px;
}
.auth-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.auth-header h1 {
  margin: 4px 0 0;
  font-size: 1.55rem;
}
.auth-header p {
  margin: 0;
  font-size: 0.94rem;
}
.auth-logo {
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.auth-field-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 3px;
}
.auth-field-hint.ok {
  color: var(--ok);
  font-weight: 600;
}
.auth-field-hint.bad {
  color: var(--bad-text);
  font-weight: 600;
}
.pw-checklist {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-top: 6px;
}
.pw-req {
  font-size: 0.81rem;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.pw-req.ok {
  border-color: var(--ok);
  background: var(--ok-soft);
  color: var(--ok);
  font-weight: 700;
}
.auth-privacy-box {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.auth-checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.95rem;
}
.auth-checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}
.auth-privacy-details summary {
  font-size: 0.83rem;
  color: var(--primary);
  cursor: pointer;
}
.auth-btn-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}
.auth-full-btn {
  width: 100%;
  justify-content: center;
}
.auth-footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 0.92rem;
}
.auth-alert {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.93rem;
  line-height: 1.45;
}
.auth-alert.error {
  background: var(--bad-soft);
  border: 1.5px solid var(--bad);
  color: var(--bad-text);
}
.auth-alert.ok, .auth-notice-box.ok {
  background: var(--ok-soft);
  border: 1.5px solid var(--ok);
  color: var(--text);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
}
.auth-mail-preview-box {
  border-radius: var(--radius-sm);
  border: 2px solid var(--primary);
  background: var(--surface-2);
  overflow: hidden;
}
.auth-mail-preview-head {
  padding: 10px 14px;
  background: var(--primary-soft);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.9rem;
}
.auth-mail-preview-body {
  padding: 14px;
}

.admin-roles-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.admin-role-card {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.admin-users-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}
.admin-user-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface-2);
}
.admin-user-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.admin-user-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.admin-role-select {
  width: auto;
  min-width: 170px;
}

.owner-badge {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
}
.share-count-badge {
  background: rgba(16, 185, 129, 0.16);
  color: var(--ok);
  border: 1px solid rgba(16, 185, 129, 0.35);
  font-weight: 700;
}

.share-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.share-modal-card {
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}
.share-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.share-modal-head h2 {
  margin: 0;
  font-size: 1.25rem;
}
.share-add-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface-2);
}
.share-current-section h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}
.share-users-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.share-user-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.share-user-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.share-user-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.share-modal-foot {
  display: flex;
  justify-content: flex-end;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* =========================================================================
   15. NYELV OLDAL: 2 FŐ KATEGÓRIA MENÜPONT (ÍRÁSBELI vs. SZÓBELI)
   ========================================================================= */
.lang-skills-hub {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.lang-skills-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}
.lang-skill-tab-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
}
.lang-skill-tab-btn:hover {
  border-color: var(--primary);
}
.lang-skill-tab-btn.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 6px 18px rgba(66, 85, 255, 0.16);
}
.lst-icon {
  font-size: 2rem;
  flex-shrink: 0;
}
.lst-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.lst-body strong {
  font-size: 1.06rem;
}
.lst-body span {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.35;
}
.lang-skill-tab-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.lang-sub-practice-box {
  padding-top: 14px;
  border-top: 1.5px solid var(--border);
}

/* =========================================================================
   16. PROFIL JELSZÓ SOR, ÖSSZECSUKHATÓ ADMIN PANELEK, AI MONDATMAGYARÁZÓ
   ========================================================================= */
.profile-pw-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  align-items: start;
}
.profile-pw-grid .field {
  margin: 0;
  display: flex;
  flex-direction: column;
}
.profile-pw-grid .field > span {
  min-height: 1.5em;
  display: flex;
  align-items: flex-end;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-collapse-panel > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  user-select: none;
}
.admin-collapse-panel > summary::-webkit-details-marker {
  display: none;
}
.admin-collapse-arrow {
  display: inline-block;
  font-size: 0.9rem;
  color: var(--primary);
  transition: transform 0.18s ease;
}
.admin-collapse-panel[open] > summary .admin-collapse-arrow {
  transform: rotate(90deg);
}
.admin-collapse-body {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.role-badge.role-banned {
  background: var(--bad-soft);
  color: var(--bad-text);
  border-color: var(--bad);
}

.explainer-struct-card {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.explainer-formula {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.86rem;
  font-weight: 700;
  width: fit-content;
}
.explainer-word-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.explainer-word-card {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.explainer-word-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.explainer-word-token {
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--primary);
}
.explainer-word-role {
  font-size: 0.76rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
}











