/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition),
              color var(--transition), box-shadow var(--transition), opacity var(--transition),
              transform 0.1s;
  white-space: nowrap;
  text-decoration: none;
  padding: 9px 16px;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:active:not(:disabled) { transform: scale(0.97); }

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-dark);
  box-shadow: 0 2px 10px rgba(37,99,235,.4);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--border);
  font-size: 12px;
}
.btn-danger:hover:not(:disabled) {
  background: var(--danger-light);
  border-color: var(--danger-border);
}

.btn-sm   { padding: 6px 12px; font-size: 12.5px; }
.btn-full { width: 100%; }

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 7px;
  border-radius: var(--radius);
  line-height: 1;
}
.btn-icon:hover { background: var(--surface-2); color: var(--text); }

.badge {
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  min-width: 22px;
  text-align: center;
  border: 1px solid var(--accent-border);
}

/* ── Cards (replacement review) ───────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.card:hover:not(.card-accepted):not(.card-skipped) {
  border-color: var(--accent-border);
  box-shadow: var(--shadow-sm);
}

.card-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .6px;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 10px;
  text-transform: uppercase;
}
.badge-person       { background: var(--accent-light);   color: var(--accent);   border: 1px solid var(--accent-border); }
.badge-place        { background: var(--success-light);  color: var(--success);  border: 1px solid var(--success-border); }
.badge-object       { background: var(--amber-light);    color: var(--amber);    border: 1px solid rgba(217,119,6,.25); }
.badge-organisation { background: rgba(168,85,247,.1);   color: #A855F7;         border: 1px solid rgba(168,85,247,.3); }
.badge-other        { background: var(--surface-2);      color: var(--text-muted); border: 1px solid var(--border); }

.card-pair {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.card-orig  { color: var(--danger);  text-decoration: line-through; font-size: 14px; font-family: 'Lora', serif; }
.card-arrow { color: var(--text-subtle); font-size: 12px; flex-shrink: 0; }
.card-rep   { color: var(--success); font-weight: 600; font-size: 14px; font-family: 'Lora', serif; }

.card-btns { display: flex; gap: 8px; }

.card.card-accepted { background: var(--success-light); border-color: var(--success-border); }
.card.card-skipped  { opacity: .4; }

/* ── Empty state ──────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-subtle);
}
.empty-icon { font-size: 32px; margin-bottom: 12px; opacity: .35; display: block; }
.empty-state p { font-size: 13.5px; font-weight: 500; color: var(--text-muted); margin-bottom: 6px; }
.empty-state small { font-size: 12.5px; line-height: 1.5; display: block; }

/* ── Knowledge list rows ─────────────────────────────────────────────── */
.kb-row {
  display: flex;
  align-items: center;
  padding: 13px 20px;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.kb-row:hover { background: var(--surface-2); }
.kb-row:last-child { border-bottom: none; }

.kb-row-info { flex: 1; min-width: 0; }
.kb-row-orig { font-size: 13.5px; font-weight: 600; color: var(--danger); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: 'Lora', serif; }
.kb-row-rep  { font-size: 12.5px; color: var(--success); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: 'Lora', serif; margin-top: 1px; }
.kb-row-type-badge { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 4px; flex-shrink: 0; }
.kb-row-actions { display: flex; gap: 4px; opacity: 0; transition: opacity var(--transition); }
.kb-row:hover .kb-row-actions { opacity: 1; }

/* ── Forms ────────────────────────────────────────────────────────────── */
.form-row { margin-bottom: 14px; }
.form-label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 5px;
}
.form-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 13.5px;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  -webkit-appearance: none;
}
.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.form-input::placeholder { color: var(--text-subtle); }
.form-textarea { resize: vertical; min-height: 100px; }

.form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 16px;
}

/* ── Toast ────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(72px);
  background: #1F2937;
  color: #fff;
  font-size: 13.5px;
  font-weight: 500;
  padding: 11px 22px;
  border-radius: 99px;
  box-shadow: var(--shadow);
  z-index: 999;
  opacity: 0;
  transition: transform .25s cubic-bezier(.4,0,.2,1), opacity .25s;
  pointer-events: none;
  white-space: nowrap;
  max-width: calc(100vw - 48px);
}
html[data-theme="dark"] .toast { background: #E8E6E3; color: #111; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Modal ────────────────────────────────────────────────────────────── */
.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 90%;
  max-width: 400px;
  z-index: 301;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.modal.open {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}
.modal-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}
.modal-body {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 24px;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
