* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

html, body {
  height: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 16px;
  line-height: 1.5;
  padding-bottom: env(safe-area-inset-bottom);
}

/* ============== TOPBAR ============== */
#topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px calc(12px) 16px;
  padding-top: calc(12px + env(safe-area-inset-top));
  background: var(--topbar-bg);
  color: var(--topbar-text);
  box-shadow: var(--shadow);
}

#page-title {
  flex: 1;
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-btn {
  background: transparent;
  border: 0;
  color: inherit;
  font-size: 24px;
  width: 40px; height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .15s;
}
.icon-btn:hover { background: rgba(255,255,255,0.15); }
.icon-btn[hidden] { display: none; }

#ui-lang-switch {
  background: rgba(255,255,255,0.12);
  border: 0;
  color: inherit;
  font-size: 13px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  appearance: none;
}
#ui-lang-switch:hover { background: rgba(255,255,255,0.2); }
#ui-lang-switch option { color: #111; background: #fff; }

/* ============== MAIN ============== */
#main {
  flex: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 16px;
  position: relative;
}

.view { display: none; animation: fadeIn .2s; }
.view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

h2 { font-size: 22px; margin-bottom: 12px; }
h3 { font-size: 16px; margin-bottom: 10px; color: var(--text-mute); text-transform: uppercase; letter-spacing: .05em; }

.hint { color: var(--text-mute); font-size: 14px; margin: 8px 0; }
.hint code { background: var(--bg-elev); padding: 2px 6px; border-radius: 4px; font-family: monospace; }

/* ============== LANG TILES (HOME) ============== */
.welcome { text-align: center; margin: 12px 0 24px; }
.welcome h2 { font-size: 26px; margin-bottom: 8px; }

.lang-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.lang-tile {
  background: var(--bg-card);
  border: 2px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-lg);
  padding: 24px 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  font-size: 17px;
  font-weight: 600;
  box-shadow: var(--shadow);
  transition: all .15s;
  min-height: 160px;
  justify-content: center;
}
.lang-tile:hover { transform: translateY(-3px); border-color: var(--primary); }
.lang-tile:active { transform: scale(.97); }
.lang-tile .flag { font-size: 48px; line-height: 1; }
.lang-tile .name { font-size: 18px; }
.lang-tile .meta {
  font-size: 12px;
  color: var(--text-mute);
  font-weight: 400;
  text-align: center;
  margin-top: 4px;
}
.lang-tile .mini-progress {
  width: 80%;
  height: 4px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}
.lang-tile .mini-progress > div {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 999px;
}

/* ============== BATCH LIST ============== */
.batch-list {
  display: grid;
  gap: 12px;
  padding-bottom: 100px;
}
.batch-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow);
  transition: transform .15s;
}
.batch-item:active { transform: scale(.98); }
.batch-item h3 {
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
  font-size: 18px;
  margin: 0;
}
.batch-item .meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-mute);
}
.badge {
  background: var(--bg-elev);
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
}

.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-mute);
}

.fab {
  position: fixed;
  bottom: 24px;
  bottom: calc(24px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: var(--primary-text);
  border: 0;
  padding: 14px 24px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow);
  z-index: 50;
}
.fab:active { transform: translateX(-50%) scale(.95); }

/* ============== INSTALL CTA ============== */
.install-cta {
  margin-top: 32px;
  padding-bottom: 20px;
}
.install-card {
  background: var(--bg-card);
  border: 2px dashed var(--primary);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow);
}
.install-icon {
  font-size: 32px;
  line-height: 1;
}
.install-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.install-text strong { font-size: 15px; }
.install-text small { color: var(--text-mute); font-size: 12px; }
.install-card .btn {
  flex-shrink: 0;
  padding: 10px 14px;
  font-size: 14px;
}
#install-hint {
  margin-top: 10px;
  padding: 12px;
  background: var(--bg-elev);
  border-radius: var(--radius);
  font-size: 13px;
  text-align: center;
}

/* ============== BATCH HEADER ============== */
.batch-header {
  background: var(--bg-card);
  padding: 16px;
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.batch-header h2 { margin-bottom: 8px; }
.batch-meta {
  display: flex;
  gap: 12px;
  font-size: 14px;
  color: var(--text-mute);
  margin-bottom: 12px;
  flex-wrap: wrap;
  align-items: center;
}

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

/* ============== ACTION GRID ============== */
.action-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.action-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-lg);
  padding: 16px 10px;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 600;
  transition: all .15s;
  box-shadow: var(--shadow);
}
.action-card:hover { transform: translateY(-2px); }
.action-card:active { transform: scale(.97); }
.action-card.primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: var(--primary-text);
  border-color: transparent;
  grid-column: span 2;
}
.action-card .ico { font-size: 28px; line-height: 1; }
.action-card small { color: var(--text-mute); font-weight: 400; font-size: 12px; }
.action-card.primary small { color: rgba(255,255,255,.85); }

/* ============== BUTTONS ============== */
.btn {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
}
.btn:hover { border-color: var(--primary); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.primary {
  background: var(--primary);
  color: var(--primary-text);
  border-color: var(--primary);
}
.btn.danger {
  color: var(--bad);
  border-color: var(--bad);
}
.btn.danger:hover { background: var(--bad); color: white; }
.btn.ghost {
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--text-mute);
}

.action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.action-row .btn { flex: 1; min-width: 120px; }

/* ============== FORMS ============== */
.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.form-row label {
  font-size: 13px;
  color: var(--text-mute);
  font-weight: 500;
}
input[type="text"], input[type="search"], input[type="password"], textarea, select {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 16px;
  font-family: inherit;
  width: 100%;
}
input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
textarea { resize: vertical; min-height: 120px; }
.search-input { margin-bottom: 12px; }

input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
}

.seg {
  display: inline-flex;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px;
}
.seg button {
  background: transparent;
  border: 0;
  color: var(--text-mute);
  padding: 8px 16px;
  border-radius: calc(var(--radius) - 3px);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all .15s;
}
.seg button.active {
  background: var(--primary);
  color: var(--primary-text);
}

.status {
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--bg-elev);
  margin: 12px 0;
  font-size: 14px;
}
.status.ok { background: rgba(22,163,74,.15); color: var(--ok); }
.status.bad { background: rgba(220,38,38,.15); color: var(--bad); }

/* ============== VOCAB LIST ============== */
.vocab-list {
  display: grid;
  gap: 8px;
}
.vocab-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  align-items: center;
}
.vocab-item .words {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.vocab-item .src { font-weight: 600; }
.vocab-item .tgt { color: var(--text-mute); font-size: 14px; }
.vocab-item .actions {
  display: flex;
  gap: 4px;
}
.vocab-item .actions button {
  background: transparent;
  border: 0;
  color: var(--text-mute);
  font-size: 18px;
  width: 36px; height: 36px;
  border-radius: 8px;
  cursor: pointer;
}
.vocab-item .actions button:hover { background: var(--bg-elev); color: var(--text); }
.vocab-item .stat {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  font-size: 12px;
  color: var(--text-mute);
  align-items: center;
}
.mastery-pip {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--border);
  display: inline-block;
}
.mastery-pip.on { background: var(--ok); }

/* ============== TRAINER ============== */
.trainer { padding-bottom: 80px; }
.train-header { margin-bottom: 16px; }
.train-stats {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-mute);
  margin-top: 6px;
}
.train-stats .ok { color: var(--ok); font-weight: 600; }
.train-stats .bad { color: var(--bad); font-weight: 600; }

.train-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  min-height: 320px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.train-prompt {
  font-size: 32px;
  font-weight: 700;
  text-align: center;
  padding: 20px 10px;
  word-break: break-word;
}
.train-sub {
  text-align: center;
  color: var(--text-mute);
  font-size: 14px;
  margin-top: -8px;
}

.choice-grid {
  display: grid;
  gap: 10px;
}
.choice {
  background: var(--bg-elev);
  border: 2px solid var(--border);
  color: var(--text);
  padding: 16px 14px;
  border-radius: var(--radius);
  font-size: 17px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: all .15s;
}
.choice:hover:not(:disabled) { border-color: var(--primary); }
.choice:active:not(:disabled) { transform: scale(.98); }
.choice.correct {
  background: var(--ok);
  color: white;
  border-color: var(--ok);
  animation: pulse .3s;
}
.choice.wrong {
  background: var(--bad);
  color: white;
  border-color: var(--bad);
  animation: shake .4s;
}
@keyframes pulse { 50% { transform: scale(1.04); } }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

.train-input-wrap {
  display: flex;
  gap: 8px;
}
.train-input-wrap input {
  flex: 1;
  font-size: 18px;
}
.train-input-wrap > button {
  padding: 0 22px;
  background: var(--primary);
  color: var(--primary-text);
  border: 0;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.mic-btn {
  background: var(--bg-elev) !important;
  color: var(--primary) !important;
  border: 2px solid var(--primary) !important;
  width: 48px;
  padding: 0 !important;
  font-size: 20px !important;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: all .15s;
}
.mic-btn:active { transform: scale(.92); }
.mic-btn.listening {
  background: var(--bad) !important;
  color: white !important;
  border-color: var(--bad) !important;
  animation: micPulse 1s infinite;
}
@keyframes micPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, .6); }
  50%      { box-shadow: 0 0 0 12px rgba(220, 38, 38, 0); }
}

.dictate-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-mute);
}
.dictate-bar .mic-btn { width: 40px; height: 40px; font-size: 18px !important; }
.dictate-bar .seg { margin-left: auto; }

.speak-btn {
  background: var(--bg-elev);
  border: 2px solid var(--primary);
  color: var(--primary);
  width: 56px; height: 56px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  display: grid;
  place-items: center;
  margin: 0 auto;
}
.speak-btn:active { transform: scale(.9); }

.feedback {
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  padding: 8px;
}
.feedback.ok { color: var(--ok); }
.feedback.bad { color: var(--bad); }
.feedback small { display: block; font-weight: 400; color: var(--text-mute); font-size: 14px; margin-top: 4px; }

.continue-btn {
  width: 100%;
  margin-top: 14px;
  padding: 16px;
  font-size: 17px;
  font-weight: 600;
  animation: continueIn .25s;
}
@keyframes continueIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============== MEMORY MODE ============== */
.memory-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.memory-card {
  aspect-ratio: 3/4;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: var(--primary-text);
  border: 0;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px;
  word-break: break-word;
  transition: all .2s;
  font-family: inherit;
}
.memory-card.flipped {
  background: var(--bg-elev);
  color: var(--text);
  border: 2px solid var(--primary);
}
.memory-card.matched {
  visibility: hidden;
}
@media (max-width: 480px) {
  .memory-card { font-size: 12px; }
}

/* ============== RESULT ============== */
.result-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 32px 20px;
  text-align: center;
  box-shadow: var(--shadow);
}
.big-stat {
  font-size: 48px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 16px 0;
}

.wrong-list-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-top: 16px;
  box-shadow: var(--shadow);
}
.wrong-list-card h4 {
  font-size: 15px;
  margin-bottom: 12px;
  color: var(--bad);
  display: flex;
  align-items: center;
  gap: 6px;
}
.wrong-list {
  display: grid;
  gap: 6px;
}
.wrong-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  gap: 8px;
  align-items: center;
  background: var(--bg-elev);
  padding: 10px 12px;
  border-radius: var(--radius);
  border-left: 3px solid var(--bad);
}
.wrong-row .src { font-weight: 600; }
.wrong-row .tgt { color: var(--text-mute); font-size: 14px; }
.wrong-row .arrow { color: var(--text-mute); font-size: 14px; }
.wrong-row button {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--primary);
  width: 36px; height: 36px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.wrong-row button:hover { background: var(--primary); color: var(--primary-text); }

/* ============== SETTINGS ============== */
.settings-block {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
}
.theme-tile {
  aspect-ratio: 1;
  border: 3px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  display: grid;
  place-items: end center;
  padding: 4px;
  font-size: 11px;
  color: white;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0,0,0,.5);
}
.theme-tile.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary);
}

#voice-pickers .form-row select { font-size: 14px; }

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  cursor: pointer;
  user-select: none;
}
.check-row input[type="checkbox"] {
  width: 22px; height: 22px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}
.check-row label { cursor: pointer; flex: 1; }

#lang-mgmt .lang-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
#lang-mgmt .lang-row:last-child { border-bottom: 0; }
#lang-mgmt .lang-row .name { flex: 1; }

/* ============== MODAL ============== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  display: grid;
  place-items: center;
  z-index: 1000;
  padding: 16px;
  animation: fadeIn .15s;
}
.modal-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow);
}
.modal-card h3 {
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
  font-size: 18px;
  margin-bottom: 16px;
}

/* ============== TOAST ============== */
.toast {
  position: fixed;
  top: 80px;
  top: calc(80px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  padding: 10px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  z-index: 2000;
  box-shadow: var(--shadow);
  animation: toastIn .2s;
  max-width: 90%;
  pointer-events: none;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, -20px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ============== TRANSLATE PREVIEW ============== */
#translate-preview {
  margin-top: 16px;
  display: grid;
  gap: 6px;
}
.preview-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: center;
  background: var(--bg-elev);
  padding: 8px 10px;
  border-radius: var(--radius);
}
.preview-row input {
  background: transparent;
  border: 0;
  padding: 4px;
  font-size: 14px;
}
.preview-row .arrow { color: var(--text-mute); }
.preview-row.loading { opacity: .5; }
.preview-row.err { background: rgba(220,38,38,.1); }

/* ============== EXPORT/IMPORT MODAL ============== */
.export-options {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.export-option {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 14px;
  border-radius: var(--radius);
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
}
.export-option:hover { border-color: var(--primary); }
.export-option strong { display: block; margin-bottom: 4px; }
.export-option small { color: var(--text-mute); font-size: 13px; }

/* ============== MARKET-INSTALLED LIST ============== */
.market-installed-list {
  list-style: none; padding: 0; margin: 14px 0 0;
  display: grid; gap: 10px;
}
.market-installed-list li {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap;
}
.market-installed-list .mi-info {
  flex: 1; min-width: 180px;
}
.market-installed-list .mi-title {
  font-weight: 600; color: var(--text);
}
.market-installed-list .mi-meta {
  font-size: 12px; color: var(--text-mute); margin-top: 2px;
}
.market-installed-list .mi-actions {
  display: flex; gap: 6px;
}
.market-installed-list button {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}
.market-installed-list button:hover { border-color: var(--primary); }
.market-installed-list button.danger {
  color: #b91c1c; border-color: rgba(185, 28, 28, .3);
}
.market-installed-list button.danger:hover {
  background: rgba(185, 28, 28, .08); border-color: #b91c1c;
}

/* ============== IN-APP MARKET ============== */
.market-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  margin-top: 14px;
}
.mk-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 6px;
  position: relative;
}
.mk-badges {
  display: flex; gap: 4px; flex-wrap: wrap;
  margin-bottom: 4px; min-height: 18px;
}
.mk-badge {
  font-size: 10px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase;
  padding: 2px 7px; border-radius: 999px;
}
.mk-feat { background: #fef3c7; color: #92400e; }
.mk-new { background: #dcfce7; color: #15803d; }
.mk-inst { background: #dbeafe; color: #1e40af; }
.mk-title { font-size: 16px; font-weight: 700; margin: 0; line-height: 1.3; }
.mk-sub { font-size: 13px; color: var(--text-mute); margin: 0; }
.mk-pair {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 4px 10px; border-radius: 999px;
  width: fit-content;
  font-size: 13px; font-weight: 600;
  margin-top: 4px;
}
.mk-pair .mk-flag { font-size: 14px; }
.mk-pair .mk-arrow { color: var(--text-mute); margin: 0 2px; }
.mk-meta { font-size: 12px; color: var(--text-mute); }
.mk-import { margin-top: 10px; }

/* ============== BATCH-LIST ACTIONS ROW ============== */
.batch-actions {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.batch-actions .btn { flex: 1; min-width: 140px; }
.batch-actions-sub {
  font-weight: 400; font-size: 12px; color: var(--text-mute);
  margin-left: 4px;
}

/* Update-available badge in market */
.mk-upd { background: #fef3c7; color: #92400e; }
.mk-import:disabled {
  opacity: .6; cursor: default;
}

/* Market filters row inside vokabeln */
.market-filters {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-top: 10px;
}
.market-filters .search-input { flex: 2; min-width: 160px; }
.market-filters select {
  flex: 1; min-width: 130px;
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 12px; font-size: 14px;
  background: var(--bg); color: var(--text);
}

/* Batch source / lock indicator */
.batch-source-line {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--text-mute);
  display: flex; align-items: center; gap: 8px;
}
.src-tag {
  font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px;
  letter-spacing: .03em;
}
.src-locked { background: #dbeafe; color: #1e40af; }
.src-edited { background: #fef3c7; color: #92400e; }
.src-when { font-size: 11px; color: var(--text-mute); }
