/* ── Back link ────────────────────────────────────────── */
.back-link {
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: none;
}
.back-link:hover {
  text-decoration: underline;
}

/* ── Spinner ──────────────────────────────────────────── */
.spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid var(--line);
  border-top-color: var(--muted);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Modal overlay ────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}
.modal-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}
.modal-card h3 {
  font-size: 1rem;
  margin: 0 0 0.75rem;
}
.modal-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 1rem;
}

/* ── Focus ring ─────────────────────────────────────── */
.focus-ring:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-color: transparent;
}

/* ── Label utilities ────────────────────────────────── */
.label-sm {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Narrow page containers ──────────────────────────── */
.narrow-page { max-width: 520px; margin: 3rem auto; padding: 0 1.5rem; color: var(--ink); }
.narrow-page-md { max-width: 600px; margin: 3rem auto; padding: 0 1.5rem; color: var(--ink); }

/* ── Loading row ─────────────────────────────────────── */
.loading-row { display: flex; align-items: center; gap: 0.75rem; margin: 1.5rem 0; }

/* ── Definition feedback (click-to-flag) ─────────────── */
.def-clickable {
  cursor: help;
  border-radius: 4px;
  border: 1px solid transparent;
  transition: border-color 0.15s;
  padding: 2px 4px;
  margin: -2px -4px;
}
.def-clickable:hover { border-color: var(--line); }
.def-flag-wrap { position: relative; display: inline-block; }
.def-flag-drop {
  position: absolute; left: 0; top: 100%; z-index: 10;
  margin-top: 6px; padding: 10px 14px;
  background: var(--card-bg, #fff); border: 1px solid var(--line);
  border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  white-space: nowrap; display: flex; align-items: center; gap: 8px;
}
.def-flag-x { font-size: 0.85em; line-height: 1; }
.def-flag-btn {
  background: none; border: 1px solid var(--line); border-radius: 6px;
  padding: 6px 12px; cursor: pointer; font-size: 0.85rem;
  color: var(--fg); transition: background 0.15s, border-color 0.15s;
  display: flex; align-items: center; gap: 8px;
}
.def-flag-btn:hover { background: var(--hover-bg, #f5f5f5); border-color: var(--accent); }
.def-flag-btn.flagged { border-color: var(--accent); color: var(--accent); }
.def-flag-drop-sm { padding: 6px 10px; }
.def-flag-drop-sm .def-flag-x { font-size: 0.75em; }
.def-flag-drop-sm .def-flag-btn { font-size: 0.75rem; padding: 4px 8px; gap: 6px; }

/* ── Feedback toast ──────────────────────────────────── */
.feedback-toast {
  position: fixed;
  transform: translate(-50%, 0);
  background: var(--ink); color: white;
  font-size: 0.85rem; padding: 0.5rem 1rem;
  border-radius: 6px; opacity: 0; pointer-events: none;
  transition: opacity 0.25s;
  z-index: 200; white-space: nowrap;
  width: max-content; height: auto;
}
.feedback-toast.visible {
  opacity: 1;
}
