:root {
  color-scheme: light;
  --bg: #f6f8fa;
  --surface: #ffffff;
  --surface-2: #eef7fb;
  --text: #0a233f;
  --muted: #5d6874;
  --line: #d8dde2;
  --teal: #0a233f;
  --teal-dark: #06182b;
  --green: #008ea9;
  --amber: #76bc43;
  --red: #c94a42;
  --aqua: #00b2e2;
  --blue-accent: #003886;
  --gray: #a7a8a9;
  --shadow: 0 18px 45px rgba(10, 35, 63, 0.1);
  --radius: 8px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(0, 178, 226, 0.1), rgba(246, 248, 250, 0) 360px),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  letter-spacing: 0;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  transform: none !important;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  margin-bottom: 26px;
}

.mobile-menu-button {
  display: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--text);
  color: #fff;
  font-weight: 800;
}

.brand-title {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.1;
}

.brand-subtitle {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav button,
.mode-button,
.ghost-button,
.primary-button,
.option-button {
  min-height: 42px;
  border-radius: var(--radius);
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
  text-align: left;
}

.nav button.active,
.nav button:hover {
  background: #e7f4f1;
  color: var(--teal-dark);
}

.nav-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: rgba(0, 178, 226, 0.13);
  color: var(--blue-accent);
  font-size: 12px;
  font-weight: 900;
}

.sidebar-footer {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 22px;
  display: grid;
  gap: 10px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--text);
  color: #fff;
  font-size: 13px;
  font-weight: 850;
}

.user-name {
  font-size: 14px;
  font-weight: 800;
}

.user-meta {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.main {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin: 0 auto 22px;
  max-width: 1180px;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1;
  font-weight: 850;
}

.topbar p {
  max-width: 640px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.topbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.primary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.primary-button {
  background: var(--teal);
  color: #fff;
  box-shadow: 0 10px 24px rgba(10, 35, 63, 0.2);
}

.primary-button:hover {
  background: var(--teal-dark);
  transform: translateY(-1px);
}

.ghost-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}

.ghost-button:hover {
  border-color: #a7c8d7;
  background: #f2f9fc;
}

.content {
  max-width: 1180px;
  margin: 0 auto;
}

.content.study-content {
  max-width: 1240px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) 390px;
  gap: 18px;
  align-items: start;
}

.study-focus-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: start;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 18px 0;
}

.panel-title {
  margin: 0;
  font-size: 16px;
  font-weight: 850;
}

.panel-note {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 18px;
}

.stat {
  min-height: 112px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.stat-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.stat-value {
  margin-top: 10px;
  font-size: 34px;
  line-height: 1;
  font-weight: 850;
}

.stat-foot {
  margin-top: 9px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0 18px 18px;
}

.mode-button {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  text-align: left;
}

.mode-button.active,
.mode-button:hover {
  border-color: rgba(0, 142, 169, 0.38);
  background: #edf8fb;
}

.mode-icon {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--teal-dark);
  font-size: 15px;
  font-weight: 900;
}

.mode-name {
  font-size: 14px;
  font-weight: 850;
}

.mode-desc {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.study-panel {
  overflow: hidden;
}

.study-card {
  padding: 18px;
}

.study-panel.focus .panel-header {
  justify-content: center;
  padding: 24px 28px 0;
  text-align: center;
}

.study-panel.focus .study-card {
  padding: 26px 34px 34px;
}

.study-panel.focus .question-meta {
  max-width: 760px;
  margin: 0 auto;
}

.study-panel.focus .prompt-word {
  margin: 30px auto 8px;
  max-width: 820px;
  text-align: center;
  font-size: clamp(46px, 8vw, 84px);
}

.study-panel.focus .prompt-type {
  text-align: center;
  font-size: 15px;
}

.study-panel.focus .definition-box {
  max-width: 820px;
  margin: 26px auto 0;
  padding: 24px;
  text-align: center;
  font-size: clamp(20px, 3vw, 30px);
  line-height: 1.35;
}

.study-panel.focus .options {
  max-width: 820px;
  margin: 28px auto 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.study-panel.focus .option-button {
  min-height: 76px;
  padding: 16px 18px;
  font-size: 16px;
}

.study-panel.focus .feedback,
.study-panel.focus .study-actions,
.study-panel.focus .type-answer {
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
}

.study-panel.focus .study-actions {
  justify-content: center;
}

.study-panel.focus .type-answer {
  display: block;
  min-height: 164px;
  margin-top: 26px;
  font-size: 17px;
}

.study-panel.focus .flashcard {
  max-width: 820px;
  min-height: 420px;
  margin: 26px auto 0;
}

.study-panel.focus .flash-word {
  font-size: clamp(54px, 9vw, 96px);
}

.activity-panel {
  position: sticky;
  top: 24px;
}

.mode-list {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.mode-list .mode-button {
  min-height: 58px;
  padding: 10px;
}

.mode-list .mode-icon {
  width: 34px;
  height: 34px;
  font-size: 13px;
}

.mode-list .mode-desc {
  display: none;
}

.activity-summary {
  margin: 0 18px 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7fbfa;
}

.activity-word {
  margin: 9px 0 12px;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 850;
}

.question-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.meta-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.session-count {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(0, 142, 169, 0.12);
  color: var(--blue-accent);
  font-size: 11px;
  font-weight: 900;
  text-transform: none;
  letter-spacing: 0;
}

.streak-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fff5e0;
  border: 1px solid #f0c060;
  color: #8a5a00;
  font-size: 11px;
  font-weight: 900;
  text-transform: none;
  letter-spacing: 0;
  white-space: nowrap;
}

.prompt-word {
  margin: 18px 0 6px;
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.05;
  font-weight: 850;
}

.prompt-type {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

/* ── Pronunciation speak button ────────────────────────────────────────── */
.speak-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  font-size: 15px !important;
  cursor: pointer;
  vertical-align: middle;
  margin-left: 6px;
  padding: 0;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  line-height: 1;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}
.speak-btn:hover {
  background: var(--bg-hover, rgba(0,0,0,0.05));
  border-color: var(--accent, #2563eb);
}
.speak-btn:active {
  transform: scale(0.9);
}
.speak-btn-sm {
  width: 24px;
  height: 24px;
  font-size: 12px !important;
  margin-left: 4px;
}

.definition-box {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f6fbfa;
  color: #253330;
  font-size: 15px;
  line-height: 1.5;
}

.options {
  display: grid;
  gap: 9px;
  margin-top: 18px;
}

.option-button {
  width: 100%;
  min-height: 54px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.option-button:hover {
  border-color: #acd3df;
  background: #f4fbfd;
}

.option-button.correct {
  border-color: rgba(118, 188, 67, 0.48);
  background: #f0faea;
  color: #315f16;
}

.option-button.wrong {
  border-color: rgba(201, 74, 66, 0.35);
  background: #fff0ef;
  color: #9b302a;
}

.feedback {
  margin-top: 14px;
  padding: 13px;
  border-radius: var(--radius);
  font-size: 14px;
  line-height: 1.45;
  font-weight: 700;
}

.feedback.good {
  background: #f0faea;
  color: #315f16;
}

.feedback.bad {
  background: #fff1e2;
  color: #8a4c0e;
}

.study-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.type-answer {
  width: 100%;
  min-height: 112px;
  margin-top: 16px;
  padding: 13px 14px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
}

.type-answer:focus {
  border-color: rgba(23, 143, 131, 0.55);
  box-shadow: 0 0 0 3px rgba(23, 143, 131, 0.1);
}

.flashcard {
  min-height: 300px;
  display: grid;
  align-content: center;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(23, 143, 131, 0.08), rgba(55, 161, 105, 0.05)),
    var(--surface);
  text-align: center;
  touch-action: pan-y;
  user-select: none;
}

.flash-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.flash-word {
  margin-top: 12px;
  font-size: clamp(34px, 6vw, 54px);
  line-height: 1;
  font-weight: 850;
}

.flash-def {
  max-width: 620px;
  margin: 18px auto 0;
  color: #263633;
  font-size: 17px;
  line-height: 1.55;
}

.mastery-list,
.history-list {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.word-row,
.history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.word-main {
  min-width: 0;
}

.word-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 14px;
  font-weight: 850;
}

.word-title span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 23px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.tag.mastered {
  background: #eef8e9;
  color: #315f16;
}

.tag.learning {
  background: #e9f6fa;
  color: var(--blue-accent);
}

.tag.reinforce {
  background: #fff2df;
  color: #92530f;
}

.word-def {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.progress-mini {
  width: 96px;
  height: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: #e8eeee;
}

.progress-mini > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.column-panel {
  min-width: 0;
}

.empty {
  padding: 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(100%, 460px);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.login-card h1 {
  margin: 18px 0 8px;
  font-size: 36px;
  line-height: 1;
}

.login-card p {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.5;
}

.name-input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
  font-size: 15px;
  font-weight: 700;
}

.name-input:focus {
  border-color: rgba(23, 143, 131, 0.55);
  box-shadow: 0 0 0 3px rgba(23, 143, 131, 0.1);
}

.login-card .primary-button {
  width: 100%;
  margin-top: 12px;
}

.login-card .name-input + .name-input {
  margin-top: 10px;
}

.login-help {
  display: grid;
  gap: 4px;
  margin-top: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7fbfa;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.login-help strong {
  color: var(--text);
}

.review-band {
  margin-top: 18px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  background: #f7fbfa;
}

.review-band strong {
  display: block;
  margin-bottom: 5px;
  font-size: 13px;
}

.review-band p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.answer-reveal {
  margin-top: 14px;
  padding: 16px;
  border-radius: var(--radius);
  border-left: 3px solid transparent;
}

.answer-reveal.correct {
  background: #f0faea;
  border-left-color: var(--amber);
}

.answer-reveal.incorrect {
  background: #f4f9ff;
  border-left-color: var(--aqua);
}

.answer-reveal-label {
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.answer-reveal.correct .answer-reveal-label {
  color: #3a6e1a;
}

.answer-reveal.incorrect .answer-reveal-label {
  color: var(--blue-accent);
}

.answer-reveal-def {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
  color: var(--text);
}

.answer-reveal-example {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}

/* ── AI Situations mode ───────────────────────────────────────────────── */

.ai-situation-box {
  margin: 18px 0 0;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--aqua);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(0, 178, 226, 0.05), rgba(0, 56, 134, 0.03));
  font-size: clamp(15px, 2.2vw, 19px);
  font-style: italic;
  font-weight: 500;
  line-height: 1.6;
  color: var(--text);
}

.ai-loading {
  display: grid;
  place-items: center;
  gap: 14px;
  min-height: 130px;
  color: var(--muted);
}

.ai-loading p {
  margin: 0;
  font-size: 13px;
  font-weight: 750;
}

.ai-loading-dots {
  display: flex;
  gap: 7px;
}

.ai-loading-dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--aqua);
  animation: dot-pulse 1.3s ease-in-out infinite;
}

.ai-loading-dots span:nth-child(2) { animation-delay: 0.18s; }
.ai-loading-dots span:nth-child(3) { animation-delay: 0.36s; }

@keyframes dot-pulse {
  0%, 80%, 100% { opacity: 0.25; transform: scale(0.75); }
  40%            { opacity: 1;    transform: scale(1);    }
}

.ai-error {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-style: italic;
}

/* ── Use in Sentence mode ────────────────────────────────────────────────── */
.uis-definition {
  margin: 12px 0 0;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7fbfa;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.uis-textarea {
  width: 100%;
  min-height: 90px;
  margin-top: 16px;
  padding: 12px 14px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  font-family: var(--font);
  line-height: 1.5;
}

.uis-textarea:focus {
  border-color: rgba(23, 143, 131, 0.55);
  box-shadow: 0 0 0 3px rgba(23, 143, 131, 0.1);
}

.uis-typed-sentence {
  margin: 14px 0;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
  font-size: 15px;
  font-style: italic;
  line-height: 1.5;
  color: var(--text);
}

.evaluation-result {
  margin-top: 12px;
  padding: 16px;
  border-radius: var(--radius);
  border-left: 3px solid transparent;
}

.evaluation-result.eval-correct {
  background: #f0faea;
  border-left-color: var(--amber);
}

.evaluation-result.eval-incorrect {
  background: #fff4ec;
  border-left-color: #e67e22;
}

.eval-label {
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 8px;
}

.eval-correct .eval-label {
  color: #3a6e1a;
}

.eval-incorrect .eval-label {
  color: #b45309;
}

.eval-feedback {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text);
}

.grammar-note {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  font-size: 13px;
  line-height: 1.45;
  color: #92400e;
}

.improved-sentence {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  font-size: 13px;
  line-height: 1.45;
  color: #1e40af;
}

/* ── Unassigned student warning ───────────────────────────────────────────── */
.unassigned-warning {
  background: #fff8e1;
  border: 1px solid #f0c060;
  border-radius: 10px;
  padding: 12px 18px;
  color: #7a5200;
  font-size: 14px;
  margin-bottom: 18px;
  line-height: 1.5;
}

/* ── Student management panel ─────────────────────────────────────────────── */
.student-list-simple {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}
.student-list-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.student-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.student-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.student-username {
  font-size: 12px;
  color: var(--muted);
}
.student-pw-badge {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 2px 9px;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.ghost-button.small {
  padding: 3px 10px;
  font-size: 12px;
  flex-shrink: 0;
}
.inline-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-top: 4px;
}
.inline-form .name-input {
  flex: 1;
  min-width: 110px;
}

/* ── Student picker (inside class form) ───────────────────────────────────── */
.student-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 6px;
  max-height: 130px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--bg);
}
.student-picker label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
  padding: 3px 4px;
  border-radius: 4px;
  transition: background 0.1s;
}
.student-picker label:hover { background: rgba(0,178,226,0.08); }

/* ── Difficulty badge ─────────────────────────────────────────────────────── */
.difficulty-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--diff-color) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--diff-color) 35%, transparent);
  color: var(--diff-color);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.difficulty-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--diff-color);
  flex-shrink: 0;
}

.difficulty-cluster {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  vertical-align: middle;
}
.difficulty-bar {
  display: inline-block;
  width: 70px;
  height: 5px;
  background: var(--line, #e5e7eb);
  border-radius: 999px;
  overflow: hidden;
  vertical-align: middle;
  flex-shrink: 0;
}
.difficulty-bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
  min-width: 2px;
}

@media (max-width: 480px) {
  .difficulty-bar { width: 50px; }
}

/* ── Cloze exercise ─────────────────────────────────────────────────────── */
.cloze-pool {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  margin: 18px 0 22px;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 5;
}
.cloze-chip {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 10px 16px;
  background: #ffffff;
  border: 2px solid #334155;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.15s ease, background 0.15s ease;
  font-family: inherit;
  line-height: 1;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 2px 0 #334155;
}
.cloze-chip:active:not(:disabled):not(.used) {
  transform: translateY(1px);
  box-shadow: 0 1px 0 #334155;
}
.cloze-chip.selected {
  background: #0f172a;
  color: #fff;
  border-color: #0f172a;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.2), 0 2px 0 #000;
}
.cloze-chip.used {
  opacity: 0.25;
  cursor: default;
  pointer-events: none;
  box-shadow: none;
  border-style: dashed;
}
.cloze-chip:disabled { opacity: 0.4; cursor: default; box-shadow: none; }

.cloze-sentences {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 8px 0 18px;
}
.cloze-sentence-row {
  padding: 16px 18px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
}
.cloze-sentence-row.row-correct {
  background: #f0fdf4;
  border-color: #86efac;
  box-shadow: 0 1px 2px rgba(22, 163, 74, 0.08);
}
.cloze-sentence-row.row-wrong {
  background: #fef2f2;
  border-color: #fca5a5;
  box-shadow: 0 1px 2px rgba(220, 38, 38, 0.08);
}
.cloze-sentence {
  font-size: 16px;
  line-height: 1.65;
  color: #0f172a;
}
.cloze-blank {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  min-height: 36px;
  padding: 4px 14px;
  margin: 0 4px;
  background: #fff;
  border: 2px dashed #94a3b8;
  border-radius: 8px;
  font-weight: 700;
  font-family: inherit;
  font-size: 14px;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
  vertical-align: middle;
  -webkit-tap-highlight-color: transparent;
  line-height: 1.2;
}
.cloze-blank:active:not(:disabled) {
  border-color: #0f172a;
  background: #f1f5f9;
}
.cloze-blank.filled {
  background: #e0e7ff;
  border-style: solid;
  border-color: #6366f1;
  color: #3730a3;
}
.cloze-blank.correct {
  background: #dcfce7;
  border-color: #16a34a;
  color: #14532d;
}
.cloze-blank.wrong {
  background: #fee2e2;
  border-color: #dc2626;
  color: #7f1d1d;
  text-decoration: line-through;
}
.cloze-blank:disabled { cursor: default; }
.cloze-correct-hint {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #86efac;
  font-size: 14px;
  color: #16a34a;
  font-weight: 600;
}
.cloze-correct-hint strong { color: #14532d; }

.cloze-results {
  text-align: center;
  font-size: 18px;
  margin: 18px 0 8px;
  color: #0f172a;
}
.cloze-results strong { font-size: 24px; }

@media (max-width: 480px) {
  .cloze-pool {
    padding: 12px;
    gap: 8px;
    margin: 14px 0 18px;
    /* On mobile, the sticky pool sits at the top so it's always reachable */
  }
  .cloze-chip {
    padding: 9px 13px;
    font-size: 13px;
    min-height: 38px;
    box-shadow: 0 2px 0 #334155;
  }
  .cloze-sentence-row {
    padding: 14px 14px;
  }
  .cloze-sentence {
    font-size: 15px;
    line-height: 1.7;
  }
  .cloze-blank {
    min-width: 72px;
    min-height: 34px;
    padding: 3px 10px;
    font-size: 13px;
    margin: 2px 3px;
  }
}

.assignment-strip {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: 0 18px 18px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7fbfa;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.assignment-strip strong {
  color: var(--text);
}

.assignment-chooser {
  padding: 14px 18px;
}

.assignment-chooser-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.assignment-chooser-header strong {
  font-size: 15px;
  font-weight: 850;
  display: block;
}

.assignment-chooser-sub {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.assignment-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.assignment-controls .ghost-button.active {
  border-color: rgba(23, 143, 131, 0.42);
  background: #f0faf7;
  color: var(--teal-dark);
}

.assignment-current {
  display: grid;
  gap: 3px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7fbfa;
}

.assignment-current strong {
  font-size: 14px;
  font-weight: 850;
}

.assignment-current span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.teacher-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 18px;
  align-items: start;
}

.teacher-form {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.teacher-form .type-answer {
  margin-top: 0;
  min-height: 150px;
}

.word-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 320px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfc;
}

.word-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px 120px;
  gap: 10px;
}

.selected-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7fbfa;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.selected-summary strong {
  color: var(--text);
  white-space: nowrap;
}

.word-picker label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
}

.word-picker label[hidden] {
  display: none;
}

.word-picker label span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.word-picker label strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.word-picker label small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.word-picker label:hover {
  border-color: var(--line);
  background: var(--surface);
}

.class-list {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.class-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.class-row-info { flex: 1; min-width: 0; }
.class-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.class-row.active {
  border-color: rgba(23, 143, 131, 0.42);
  background: #f0faf7;
}
.class-row.editing {
  border-color: var(--blue-accent);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

/* Danger ghost button (delete) */
.ghost-button.danger {
  color: #c94a42;
  border-color: #fbd5d3;
}
.ghost-button.danger:hover { background: #fdf1f0; }

/* Inline edit panel */
.class-edit-panel {
  border: 1px solid var(--blue-accent);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  background: #f7f9ff;
  padding: 16px;
  margin-bottom: 2px;
}
.class-edit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  font-size: 14px;
}
.edit-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.progress-table {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.student-row {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.student-metrics,
.student-weakness {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.student-metrics span,
.student-weakness span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f7fbfa;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.student-metrics strong {
  color: var(--text);
}

.teacher-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 18px;
  align-items: start;
}

.teacher-student-list {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.teacher-inspector-grid {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.student-index-panel {
  position: sticky;
  top: 24px;
}

.student-search-box {
  padding: 18px 18px 0;
}

.teacher-student-list.compact {
  max-height: 560px;
  overflow: auto;
}

.teacher-student-card {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-align: left;
}

.teacher-student-card:hover,
.teacher-student-card.active {
  border-color: rgba(23, 143, 131, 0.42);
  background: #f0faf7;
}

.teacher-student-card.compact {
  grid-template-columns: 1fr;
}

.teacher-student-card[hidden] {
  display: none;
}

.teacher-student-bars {
  display: grid;
  gap: 10px;
}

.metric-bar {
  display: grid;
  gap: 6px;
}

.metric-bar > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.metric-bar strong {
  color: var(--text);
}

.teacher-word-stat {
  display: grid;
  justify-items: end;
  gap: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.teacher-word-stat strong {
  color: var(--amber);
  font-size: 24px;
  line-height: 1;
}

.student-detail-list {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.student-summary-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 18px 18px 0;
}

.student-summary-strip .stat {
  min-height: 92px;
  padding: 13px;
}

.student-word-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.detail-footnote {
  padding: 0 18px 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand {
    margin-bottom: 12px;
  }

  .nav {
    grid-template-columns: repeat(3, 1fr);
  }

  .sidebar-footer {
    position: static;
    margin-top: 12px;
  }

  .main {
    padding: 20px 14px 28px;
  }

  .topbar {
    display: grid;
  }

  .topbar-actions {
    justify-content: flex-start;
  }

  .dashboard-grid,
  .study-focus-grid,
  .teacher-grid,
  .teacher-dashboard-grid,
  .teacher-inspector-grid,
  .assignment-chooser,
  .columns {
    grid-template-columns: 1fr;
  }

  .student-index-panel {
    position: static;
  }

  .activity-panel {
    position: static;
  }

  .mode-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  body {
    background:
      linear-gradient(180deg, rgba(0, 178, 226, 0.12), rgba(246, 248, 250, 0) 260px),
      var(--bg);
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 10px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
  }

  .brand {
    margin-bottom: 0;
  }

  .brand-title {
    font-size: 15px;
  }

  .brand-subtitle,
  .sidebar-footer,
  .nav {
    display: none;
  }

  .mobile-menu-button {
    margin-left: auto;
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--blue-accent);
    font-size: 12px;
    font-weight: 850;
  }

  .sidebar:focus-within .nav,
  .sidebar:hover .nav,
  .sidebar.menu-open .nav {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    margin-top: 10px;
  }

  .sidebar:focus-within .nav button,
  .sidebar:hover .nav button,
  .sidebar.menu-open .nav button {
    justify-content: flex-start;
    min-height: 42px;
    padding: 0 10px;
  }

  .sidebar.menu-open .sidebar-footer {
    display: flex;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
  }

  .main {
    padding: 10px 8px 18px;
  }

  .topbar {
    display: none;
  }

  .content.study-content {
    max-width: 100%;
  }

  .study-focus-grid,
  .study-panel,
  .activity-panel {
    min-width: 0;
    width: 100%;
  }

  .stats-row,
  .mode-grid,
  .mode-list,
  .study-panel.focus .options {
    grid-template-columns: 1fr;
  }

  .study-panel.focus .panel-header {
    padding: 14px 12px 0;
  }

  .study-panel.focus .study-card {
    padding: 14px 12px 18px;
  }

  .study-panel.focus .question-meta {
    font-size: 11px;
  }

  .study-panel.focus .prompt-word {
    margin-top: 14px;
    text-align: center;
    font-size: clamp(28px, 10vw, 44px);
  }

  .study-panel.focus .prompt-type {
    text-align: center;
  }

  .study-panel.focus .definition-box {
    text-align: center;
    font-size: 17px;
    padding: 14px;
  }

  .study-panel.focus .options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 14px;
  }

  .study-panel.focus .option-button {
    min-height: 56px;
    padding: 10px 12px;
    font-size: 13px;
  }

  .study-panel.focus .study-actions {
    position: sticky;
    bottom: 10px;
    z-index: 5;
  }

  .study-panel.focus .study-actions .primary-button,
  .study-panel.focus .study-actions .ghost-button {
    min-height: 48px;
    flex: 1 1 auto;
  }

  .study-panel.focus .flashcard {
    min-height: 240px;
  }

  .study-panel.focus .flash-word {
    font-size: 36px;
  }

  .swipe-hint {
    display: flex;
    justify-content: space-between;
    padding: 6px 4px 0;
    font-size: 11px;
    font-weight: 800;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }

  .word-row,
  .history-row,
  .class-row {
    grid-template-columns: 1fr;
  }

  .word-picker {
    grid-template-columns: 1fr;
  }

  .assignment-chooser {
    padding: 12px;
    margin-bottom: 10px;
  }

  .assignment-chooser summary strong {
    font-size: 14px;
  }

  .assignment-chooser summary small {
    font-size: 11px;
  }

  .change-label {
    min-height: 28px;
    font-size: 12px;
  }

  .assignment-select-wrap {
    margin-top: 10px;
  }

  .activity-panel .panel-header {
    display: none;
  }

  .activity-panel {
    order: -1;
  }

  .activity-panel .panel-note {
    display: none;
  }

  .mode-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 10px;
    scrollbar-width: none;
  }

  .mode-list::-webkit-scrollbar {
    display: none;
  }

  .mode-list .mode-button {
    flex: 0 0 124px;
    min-height: 46px;
    padding: 8px;
  }

  .mode-list .mode-name {
    font-size: 12px;
  }

  .mode-list .mode-icon {
    width: 30px;
    height: 30px;
    font-size: 12px;
  }

  .activity-summary {
    display: none;
  }

  .study-panel.focus .options {
    grid-template-columns: 1fr;
  }

  .student-summary-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .word-tools,
  .assignment-controls,
  .student-row,
  .teacher-student-card,
  .student-word-row {
    grid-template-columns: 1fr;
  }

  .student-summary-strip {
    grid-template-columns: 1fr;
  }

  .teacher-word-stat {
    justify-items: start;
  }

  .progress-mini {
    width: 100%;
  }

  .topbar h1,
  .login-card h1 {
    font-size: 30px;
  }
}

/* ── Hero CTA (student dashboard) ───────────────────────────────────────── */
.hero-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 26px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #fff;
  border-radius: 16px;
  margin-bottom: 18px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
}
.hero-cta-text h2 {
  margin: 0 0 4px 0;
  font-size: 22px;
  font-weight: 700;
}
.hero-cta-text p {
  margin: 0;
  font-size: 14px;
  opacity: 0.85;
}
.hero-cta-button {
  font-size: 16px;
  padding: 12px 24px;
  flex-shrink: 0;
  background: #fff;
  color: #0f172a;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.hero-cta-button:hover { transform: translateY(-1px); }
.hero-cta-button:active { transform: translateY(0); }

.mode-picker-collapsible {
  margin-top: 14px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.mode-picker-collapsible summary {
  cursor: pointer;
  font-size: 14px;
  color: var(--muted);
  list-style: none;
}
.mode-picker-collapsible summary::-webkit-details-marker { display: none; }
.mode-picker-collapsible summary strong { color: var(--text); }
.mode-picker-collapsible[open] summary { margin-bottom: 12px; }

/* ── Teacher sub-tabs ───────────────────────────────────────────────────── */
.teacher-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 18px;
  padding: 6px;
  background: var(--surface-2, #f1f5f9);
  border-radius: 12px;
  overflow-x: auto;
}
.teacher-tab {
  flex: 1;
  min-width: max-content;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}
.teacher-tab:hover { background: rgba(0, 0, 0, 0.04); color: var(--text); }
.teacher-tab.active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.teacher-tab-count {
  display: inline-block;
  padding: 1px 8px;
  font-size: 11px;
  background: var(--line);
  color: var(--muted);
  border-radius: 999px;
  font-weight: 700;
}
.teacher-tab.active .teacher-tab-count {
  background: #e0e7ff;
  color: #4338ca;
}

/* ── Quiz stepper ───────────────────────────────────────────────────────── */
.quiz-stepper { gap: 0; }
.quiz-step {
  display: flex;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px dashed var(--line);
}
.quiz-step:last-of-type { border-bottom: none; }
.step-num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #0f172a;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}
.step-body { flex: 1; min-width: 0; }
.step-body h3 {
  margin: 0 0 10px 0;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.step-body h3 small {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}
.step-count {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: #e0e7ff;
  color: #4338ca;
  padding: 2px 10px;
  border-radius: 999px;
}

/* ── Vocabulary bank list ───────────────────────────────────────────────── */
.vocab-bank-list { display: flex; flex-direction: column; gap: 6px; }
.vocab-bank-row {
  display: grid;
  grid-template-columns: 1fr 100px 2fr;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--surface-2, #f8fafc);
  font-size: 13px;
  align-items: center;
}
.vocab-bank-row .muted { color: var(--muted); font-size: 12px; }
.vocab-bank-def { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── User menu dropdown ─────────────────────────────────────────────────── */
.user-chip-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease;
}
.user-chip-button:hover { background: rgba(0, 0, 0, 0.04); }
.user-chip-button.open { background: rgba(0, 0, 0, 0.05); border-color: var(--line); }
.user-chip-text { flex: 1; min-width: 0; }
.user-chip-text .user-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip-text .user-meta { font-size: 11px; color: var(--muted); }
.user-chip-caret { color: var(--muted); transition: transform 0.15s ease; }
.user-chip-button.open .user-chip-caret { transform: rotate(180deg); }

.user-menu {
  display: none;
  flex-direction: column;
  margin-top: 6px;
  padding: 4px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}
.user-menu.open { display: flex; }
.user-menu-item {
  text-align: left;
  padding: 9px 12px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  transition: background 0.1s ease;
}
.user-menu-item:hover { background: rgba(0, 0, 0, 0.04); }
.user-menu-item.danger:hover { background: #fef2f2; color: #b91c1c; }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
