/* ============================================================
   public/css/style.css – Family Tree Manager (redesigned)
   Clean, polished stylesheet with no external dependencies.
   ============================================================ */

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --color-primary:     #2563eb;
  --color-primary-d:   #1d4ed8;
  --color-primary-l:   #eff6ff;
  --color-danger:      #ef4444;
  --color-danger-d:    #dc2626;
  --color-danger-l:    #fef2f2;
  --color-warning:     #f59e0b;
  --color-warning-d:   #d97706;
  --color-info:        #0ea5e9;
  --color-info-d:      #0284c7;
  --color-success:     #10b981;
  --color-secondary:   #6b7280;
  --color-secondary-d: #4b5563;
  --bg:        #f1f5f9;
  --surface:   #ffffff;
  --surface-2: #f8fafc;
  --border:    #e2e8f0;
  --border-strong: #cbd5e1;
  --text:       #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --navbar-bg:    #0f172a;
  --navbar-text:  #e2e8f0;
  --navbar-muted: #94a3b8;
  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.06);
  --shadow:    0 1px 3px rgba(0,0,0,.10), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.10), 0 2px 4px -1px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.10), 0 4px 6px -2px rgba(0,0,0,.05);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --transition: .15s ease;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── NAVBAR ──────────────────────────────────────────────── */
.navbar {
  background: var(--navbar-bg);
  border-bottom: 1px solid rgba(255,255,255,.06);
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1.75rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: .65rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navbar-text);
  letter-spacing: -.01em;
}
.navbar-brand:hover { text-decoration: none; color: #fff; }

.navbar-logo { width: 34px; height: 34px; border-radius: 8px; }

.nav-links {
  list-style: none;
  display: flex;
  gap: .25rem;
  align-items: center;
}

.nav-links a {
  color: var(--navbar-muted);
  font-weight: 500;
  font-size: .9rem;
  padding: .4rem .75rem;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}
.nav-links a:hover { color: #fff; background: rgba(255,255,255,.08); text-decoration: none; }
.nav-links .btn { margin-left: .5rem; }

/* ── LAYOUT ──────────────────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1.5rem;
  flex: 1;
}

.footer {
  text-align: center;
  padding: 1.25rem;
  color: var(--text-light);
  font-size: .8125rem;
  border-top: 1px solid var(--border);
  margin-top: 1rem;
  background: var(--surface);
}

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  padding: .5rem 1.1rem;
  border: none;
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: filter var(--transition), transform var(--transition), box-shadow var(--transition);
  white-space: nowrap;
  line-height: 1.4;
}
.btn:hover  { filter: brightness(1.08); text-decoration: none; }
.btn:active { filter: brightness(.96); transform: translateY(1px); }

.btn-primary   { background: var(--color-primary);   color: #fff; box-shadow: 0 1px 3px rgba(37,99,235,.35); }
.btn-danger    { background: var(--color-danger);    color: #fff; box-shadow: 0 1px 3px rgba(239,68,68,.30); }
.btn-warning   { background: var(--color-warning);   color: #fff; box-shadow: 0 1px 3px rgba(245,158,11,.30); }
.btn-info      { background: var(--color-info);      color: #fff; }
.btn-secondary {
  background: var(--surface);
  color: #374151;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover { background: var(--surface-2); filter: none; }

.btn-sm  { padding: .35rem .8rem;  font-size: .8125rem; border-radius: var(--radius-sm); }
.btn-xs  { padding: .2rem .5rem;   font-size: .75rem;   border-radius: var(--radius-sm); line-height: 1; }

.btn-chip-remove {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-light);
  padding: .3rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition), color var(--transition);
  line-height: 1;
  margin-left: auto;
}
.btn-chip-remove:hover { background: var(--color-danger-l); color: var(--color-danger); }

/* ── PAGE HEADER ─────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: 1.75rem;
}

.page-header h1 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.02em;
}

.header-actions {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  align-items: center;
}

/* ── CARD ────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.card h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1.1rem;
  padding-bottom: .65rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: .5rem;
  letter-spacing: -.01em;
}
.card h2 svg { color: var(--text-muted); flex-shrink: 0; }

/* ── AVATAR ──────────────────────────────────────────────── */
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .8125rem;
  flex-shrink: 0;
  text-transform: uppercase;
  background: #e2e8f0;
  color: #475569;
  border: 2px solid var(--surface);
  box-shadow: var(--shadow-sm);
  user-select: none;
}
.avatar[data-gender="M"]     { background: #dbeafe; color: #1d4ed8; }
.avatar[data-gender="F"]     { background: #fce7f3; color: #9d174d; }
.avatar[data-gender="Other"] { background: #ede9fe; color: #6d28d9; }
.avatar-lg { width: 52px; height: 52px; font-size: 1.2rem; border-width: 3px; }
img.avatar, img.avatar-lg { object-fit: cover; display: block; }

/* ── PERSON CHIP ─────────────────────────────────────────── */
.person-chip {
  display: flex;
  align-items: center;
  gap: .625rem;
  padding: .55rem .75rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: box-shadow var(--transition), border-color var(--transition);
}
.person-chip:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); }

.person-chip-name {
  font-weight: 500;
  font-size: .9375rem;
  color: var(--text);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.person-chip-name:hover { color: var(--color-primary); text-decoration: none; }

.person-chip-badge {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .15rem .5rem;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}
.badge-father  { background: #dbeafe; color: #1d4ed8; }
.badge-mother  { background: #fce7f3; color: #9d174d; }
.badge-child   { background: #d1fae5; color: #065f46; }
.badge-sibling { background: #e0e7ff; color: #4338ca; }
.badge-spouse  { background: #fef3c7; color: #92400e; }

/* ── RELATIONSHIP GROUPS ─────────────────────────────────── */
.rel-group {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.rel-group:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.rel-group-header {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin-bottom: .75rem;
}
.rel-group-header h3 {
  font-size: .9375rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.01em;
}
.rel-group-header svg { color: var(--text-muted); }

.rel-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: .5rem;
}

/* Legacy badge classes */
.rel-badge {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .1rem .45rem;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}
.rel-badge-father { background: #dbeafe; color: #1d4ed8; }
.rel-badge-mother { background: #fce7f3; color: #9d174d; }
.rel-badge-child  { background: #d1fae5; color: #065f46; }

/* ── TABLE ───────────────────────────────────────────────── */
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.table th {
  background: var(--surface-2);
  text-align: left;
  padding: .7rem 1rem;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table td {
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-size: .9375rem;
}

.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #f0f7ff; }

.table .actions {
  display: flex;
  gap: .4rem;
  align-items: center;
  flex-wrap: nowrap;
}

.table-person-cell {
  display: flex;
  align-items: center;
  gap: .6rem;
}
.table-person-cell a { font-weight: 500; color: var(--text); }
.table-person-cell a:hover { color: var(--color-primary); text-decoration: none; }

.gender-tag {
  display: inline-block;
  font-size: .75rem;
  font-weight: 600;
  padding: .15rem .55rem;
  border-radius: 20px;
}
.gender-tag-m { background: #dbeafe; color: #1e40af; }
.gender-tag-f { background: #fce7f3; color: #9d174d; }
.gender-tag-o { background: #ede9fe; color: #5b21b6; }

.status-tag { display: inline-block; font-size: .75rem; font-weight: 600; padding: .15rem .55rem; border-radius: 20px; }
.status-alive    { background: #d1fae5; color: #065f46; }
.status-deceased { background: #f3f4f6; color: #6b7280; }

/* ── FORMS ───────────────────────────────────────────────── */
.form-row {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-bottom: 1.1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 200px;
}

.form-group label {
  font-size: .8125rem;
  font-weight: 700;
  margin-bottom: .35rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.form-control {
  padding: .55rem .8rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: .9375rem;
  font-family: var(--font);
  background: var(--surface);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.18);
}

.form-actions {
  display: flex;
  gap: .75rem;
  margin-top: 1.75rem;
  flex-wrap: wrap;
}

/* Add Relationship form */
.rel-add-form {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: .75rem;
  padding: 1.1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.rel-add-sentence {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .6rem;
  flex: 1;
}

.rel-add-sentence .rel-subject { font-weight: 700; font-size: .9375rem; white-space: nowrap; color: var(--text); }
.rel-add-sentence .rel-verb    { font-size: .875rem; color: var(--text-muted); white-space: nowrap; }
.rel-add-sentence .form-control { flex: 1; min-width: 140px; }

/* Inline form compatibility */
.form-inline { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; }
.form-inline .form-group { flex-direction: row; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: 0; }
.form-inline .form-group label { margin-bottom: 0; white-space: nowrap; text-transform: none; font-size: .875rem; }

/* ── INFO GRID ───────────────────────────────────────────── */
.info-grid {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: .6rem 1.5rem;
}

.info-grid dt {
  font-weight: 700;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  white-space: nowrap;
  display: flex;
  align-items: center;
}

.info-grid dd { font-size: .9375rem; display: flex; align-items: center; }

code.person-id {
  font-family: "SFMono-Regular", "Consolas", "Courier New", monospace;
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: .1em;
  background: var(--color-primary-l);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-sm);
  padding: .2rem .55rem;
  color: var(--color-primary-d);
  user-select: all;
}

/* ── ALERTS ──────────────────────────────────────────────── */
.alert {
  padding: .9rem 1.1rem;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  font-size: .9375rem;
  border-left-width: 4px;
  border-left-style: solid;
}

.alert-danger {
  background: var(--color-danger-l);
  border-color: var(--color-danger);
  color: #7f1d1d;
}

.alert ul { margin-top: .5rem; padding-left: 1.25rem; }
.alert li { margin-bottom: .25rem; }

/* ── MISC HELPERS ────────────────────────────────────────── */
.text-muted  { color: var(--text-muted); }
.required    { color: var(--color-danger); }

.empty-state {
  text-align: center;
  padding: 3.5rem 1rem;
  color: var(--text-muted);
}
.empty-state-icon {
  width: 56px; height: 56px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1rem;
  color: var(--text-light);
}
.empty-state p { margin-bottom: 1.25rem; font-size: 1rem; font-weight: 500; }

.error-page { text-align: center; padding: 5rem 1rem; }
.error-page h1   { font-size: 2.25rem; margin-bottom: .75rem; font-weight: 800; letter-spacing: -.03em; }
.error-message   { color: var(--text-muted); margin-bottom: 2rem; font-size: 1.1rem; }

/* ── SEARCH BAR ──────────────────────────────────────────── */
.search-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: .875rem 1.1rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.search-bar-inner {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
}

.search-input-wrap {
  position: relative;
  flex: 1 1 220px;
  min-width: 180px;
}

.search-icon {
  position: absolute;
  left: .7rem; top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: .5rem .75rem .5rem 2.2rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: .9rem;
  font-family: var(--font);
  color: var(--text);
  background: var(--surface-2);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
  background: var(--surface);
}

.search-select {
  padding: .5rem .8rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: .9rem; font-family: var(--font);
  color: var(--text); background: var(--surface-2);
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
  flex: 0 0 auto;
}
.search-select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

.search-results-count { margin: .6rem 0 0; font-size: .8rem; color: var(--text-muted); font-weight: 500; }

/* Advanced filter row */
.search-bar-advanced {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1.2rem;
  margin-top: .75rem;
  padding-top: .75rem;
  border-top: 1px solid var(--border);
}
.filter-group { display: flex; flex-direction: column; gap: .25rem; flex: 1 1 180px; min-width: 150px; }
.filter-label { font-size: .72rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.filter-range { display: flex; align-items: center; gap: .35rem; }
.filter-range-sep { font-size: .8rem; color: var(--text-light); }
.form-control-sm {
  padding: .35rem .55rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: .82rem;
  font-family: var(--font);
  color: var(--text);
  background: var(--surface-2);
  flex: 1;
  min-width: 0;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control-sm:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
  background: var(--surface);
}
.search-bar-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: .45rem;
}
.search-advanced-toggle {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: none;
  border: none;
  padding: .2rem 0;
  font-size: .78rem;
  font-family: var(--font);
  color: var(--color-primary);
  cursor: pointer;
  font-weight: 600;
  transition: color var(--transition);
}
.search-advanced-toggle:hover { color: var(--color-primary-hover); }

/* ── EXPORT / SPECIAL BUTTONS ────────────────────────────── */
.export-group { display: flex; align-items: center; gap: .4rem; }
.export-label { font-size: .8rem; font-weight: 700; color: var(--text-muted); white-space: nowrap; text-transform: uppercase; letter-spacing: .04em; }

.btn-export-excel { background: #16a34a; color: #fff; box-shadow: 0 1px 3px rgba(22,163,74,.30); }
.btn-export-excel:hover { background: #15803d; filter: none; }
.btn-export-json  { background: #7c3aed; color: #fff; box-shadow: 0 1px 3px rgba(124,58,237,.30); }
.btn-export-json:hover  { background: #6d28d9; filter: none; }
.btn-tree-api { background: #1e293b; color: #e2e8f0; box-shadow: 0 1px 3px rgba(0,0,0,.20); }
.btn-tree-api:hover { background: #334155; filter: none; }

/* ── CONFIRMATION MODAL ──────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  backdrop-filter: blur(4px);
}
.modal-overlay[hidden] { display: none; }

.modal-box {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 64px rgba(0,0,0,.28);
  width: 100%;
  max-width: 460px;
  overflow: hidden;
  animation: modalIn .18s cubic-bezier(.25,.8,.25,1);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(.94) translateY(-12px); }
  to   { opacity: 1; transform: scale(1)   translateY(0);     }
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 1.1rem; font-weight: 700; margin: 0; color: var(--text); letter-spacing: -.01em; }

.modal-body { padding: 1.25rem 1.5rem; }

.modal-detail { display: flex; flex-direction: column; gap: .55rem; }

.modal-row { display: flex; gap: .75rem; align-items: baseline; }
.modal-row-label {
  min-width: 110px; flex-shrink: 0;
  font-size: .7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted);
}
.modal-row-value { font-size: .9375rem; font-weight: 600; color: var(--text); word-break: break-word; }
.modal-row-warn  { color: var(--color-danger); }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: .75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

/* ── HAMBURGER TOGGLE (hidden on desktop) ────────────────── */
.nav-toggle {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: .5rem;
  z-index: 110;
  flex-direction: column;
  gap: 4px;
}
.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2.5px;
  background: var(--navbar-text);
  border-radius: 2px;
  transition: transform .25s ease, opacity .2s ease;
}
/* Animate to X when open */
.nav-toggle.open .nav-toggle-bar:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle.open .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle.open .nav-toggle-bar:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ── RESPONSIVE – Tablet (≤ 768px) ──────────────────────── */
@media (max-width: 768px) {
  .container { margin: 1.25rem auto; padding: 0 1rem; }
  .page-header h1 { font-size: 1.5rem; }

  /* Navbar: hamburger + slide-down menu */
  .nav-toggle { display: flex; }
  .navbar { flex-wrap: wrap; padding: .65rem 1rem; }

  .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    gap: 0;
    padding: .5rem 0 .25rem;
    order: 3;            /* push below brand + toggle */
  }
  .nav-links.open { display: flex; }

  .nav-links li { width: 100%; }
  .nav-links a {
    display: block;
    padding: .65rem .75rem;
    border-radius: var(--radius-sm);
    font-size: .95rem;
  }
  .nav-links .btn { margin-left: 0; margin-top: .35rem; text-align: center; }

  /* Dashboard */
  .dash-header { flex-direction: column; align-items: flex-start; gap: .75rem; }
  .dash-header-actions { width: 100%; }
  .stat-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .75rem; }

  /* Charts */
  .chart-grid { grid-template-columns: 1fr; }

  /* Table horizontal scroll */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -1rem; padding: 0 1rem; }

  /* Search hero */
  .search-hero-inner { flex-wrap: wrap; gap: .5rem; padding: .5rem .75rem; }
  .search-hero-input { font-size: .95rem; min-width: 0; }

  /* Relationship finder path */
  .rf-path { flex-direction: column; align-items: flex-start; gap: .75rem; }
  .rf-path-step { flex-direction: column; align-items: flex-start; }
  .rf-path-connector { flex-direction: row; gap: .35rem; }
  .rf-arrow-line { transform: rotate(90deg); }

  /* Person show: header with avatar */
  .page-header > div[style*="display:flex"] { flex-wrap: wrap; }

  /* Search bar filters stack */
  .search-bar-inner { flex-direction: column; align-items: stretch; }
  .search-input-wrap { flex: 1 1 100%; min-width: 0; }
  .search-select { width: 100%; }
  .search-bar-advanced { flex-direction: column; }
  .filter-group { flex: 1 1 100%; }

  /* Relationship finder */
  .rf-selectors { grid-template-columns: 1fr; }

  /* Export buttons */
  .export-group { flex-wrap: wrap; }
}

/* ── RESPONSIVE – Mobile (≤ 640px) ──────────────────────── */
@media (max-width: 640px) {
  .container { margin: 1rem auto; padding: 0 .75rem; }

  /* Page header */
  .page-header { flex-direction: column; align-items: flex-start; gap: .6rem; }
  .page-header h1 { font-size: 1.3rem; }

  /* Forms */
  .form-row { flex-direction: column; gap: .75rem; }
  .form-group { min-width: 0; }
  .form-actions { flex-direction: column; }
  .form-actions .btn { width: 100%; }

  /* Add-relationship form */
  .rel-add-form { flex-direction: column; align-items: stretch; }
  .rel-add-sentence { flex-direction: column; align-items: flex-start; }
  .rel-add-sentence .form-control { width: 100%; min-width: 0; }

  /* Table */
  .table { font-size: .82rem; }
  .table td, .table th { padding: .5rem .6rem; }
  .table .actions { gap: .25rem; }

  /* Cards */
  .card { padding: 1.15rem; margin-bottom: 1rem; }

  /* Relationship list */
  .rel-list { grid-template-columns: 1fr; }

  /* Dashboard */
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: .6rem; }
  .stat-card { padding: .85rem; gap: .65rem; }
  .stat-value { font-size: 1.45rem; }
  .stat-label { font-size: .72rem; }
  .dash-two-col { grid-template-columns: 1fr; gap: 1rem; }
  .quick-links { grid-template-columns: repeat(2, 1fr); gap: .5rem; }

  /* Modal */
  .modal-box { max-width: 100%; border-radius: var(--radius-lg); }
  .modal-header { padding: 1rem 1.15rem; }
  .modal-body   { padding: 1rem 1.15rem; }
  .modal-footer {
    flex-direction: column-reverse;
    padding: .85rem 1.15rem;
  }
  .modal-footer .btn { width: 100%; }
  .modal-row { flex-direction: column; gap: .15rem; }
  .modal-row-label { min-width: unset; }

  /* Timeline */
  .timeline-wrap { padding-left: 2rem; }
  .tl-year-label { left: -2rem; font-size: .72rem; padding: .15rem .5rem; }
  .tl-content { padding: .55rem .75rem; }

  /* Search hero */
  .search-hero-inner { padding: .5rem .75rem; border-radius: var(--radius-lg); }
  .search-hero-input { font-size: .95rem; }

  /* Pagination */
  .pagination { flex-direction: column; align-items: stretch; text-align: center; gap: .5rem; }
  .pagination-controls { justify-content: center; }

  /* Breadcrumb */
  .breadcrumb { font-size: .78rem; }

  /* Person chip */
  .person-chip { padding: .45rem .6rem; gap: .5rem; }

  /* Info grid */
  .info-grid { grid-template-columns: 1fr; gap: .5rem; }
  .info-grid dt { font-size: .72rem; }
  .info-grid dd { font-size: .875rem; }

  /* Kinship banner */
  .rf-kinship-banner { flex-direction: column; align-items: flex-start; gap: .5rem; padding: .75rem 1rem; }
  .rf-kinship-text { font-size: .95rem; }

  /* Relationship finder path */
  .rf-path-node { align-items: flex-start; }
  .rf-node-name { max-width: none; text-align: left; }

  /* Search table: hide less vital columns */
  .table .hide-sm { display: none; }

  /* Person chip responsive */
  .person-chip-badge { font-size: .65rem; padding: .1rem .4rem; }
}

/* ── RESPONSIVE – Small phones (≤ 400px) ─────────────────── */
@media (max-width: 400px) {
  .container { padding: 0 .5rem; }
  .navbar { padding: .5rem .65rem; }
  .navbar-brand span { font-size: .95rem; }
  .navbar-logo { width: 28px; height: 28px; }

  .stat-grid { grid-template-columns: 1fr; }
  .stat-card { flex-direction: row; }

  .page-header h1 { font-size: 1.15rem; }

  .btn { padding: .45rem .85rem; font-size: .82rem; }
  .btn-sm { padding: .3rem .65rem; font-size: .78rem; }

  .card { padding: .9rem; border-radius: var(--radius); }

  .table td, .table th { padding: .4rem .45rem; font-size: .78rem; }

  /* Hide less essential table columns on tiny screens */
  .table .hide-xs { display: none; }
  .table .hide-sm { display: none; }

  .quick-links { grid-template-columns: 1fr; }
  .quick-link { flex-direction: row; padding: .75rem; gap: .6rem; }
  .ql-icon { font-size: 1.3rem; }
}

/* ── ACTION DROPDOWN (3-dot menu for mobile) ────────────────── */
.action-dropdown {
  position: relative;
  display: inline-flex;
}

/* The 3-dot trigger – hidden on desktop */
.action-dot-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1.15rem;
  line-height: 1;
  transition: background var(--transition), color var(--transition);
}
.action-dot-btn:hover { background: var(--surface-2); color: var(--text); }

/* The dropdown panel */
.action-dropdown-menu {
  /* On desktop: just render inline as normal flex row */
  display: flex;
  gap: .4rem;
  align-items: center;
  flex-wrap: nowrap;
}

/* ── Mobile: show 3-dot, hide inline buttons ── */
@media (max-width: 768px) {
  .action-dot-btn { display: flex; }

  .action-dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 4px;
    flex-direction: column;
    align-items: stretch;
    min-width: 120px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: .35rem;
    z-index: 50;
    gap: .2rem;
  }
  .action-dropdown-menu.open { display: flex; }

  .action-dropdown-menu .btn {
    width: 100%;
    justify-content: flex-start;
    font-size: .8rem;
    padding: .4rem .65rem;
  }
}

/* ── Add Relationship – improved form ───────────────────────── */
.rel-add-row {
  margin-bottom: 1.1rem;
}

.rel-add-field {}

.rel-add-label {
  display: block;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  margin-bottom: .5rem;
}

/* ── Relationship type chips (radio buttons styled as pills) ── */
.rel-type-grid {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}

.rel-type-chip {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: .35rem;
}

.rel-type-chip input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0; height: 0;
}

.rel-type-chip span {
  display: inline-flex;
  align-items: center;
  padding: .4rem .95rem;
  border: 1.5px solid var(--border-strong);
  border-radius: 20px;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-2);
  transition: border-color var(--transition), background var(--transition), color var(--transition), box-shadow var(--transition);
  user-select: none;
}

.rel-type-chip:hover span {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-l);
}

.rel-type-chip.active span,
.rel-type-chip input:checked ~ span {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 1px 4px rgba(37,99,235,.30);
}

/* ── Person search box ──────────────────────────────────────── */
.rel-person-search-wrap {
  position: relative;
  margin-bottom: .6rem;
}

.rel-search-icon {
  position: absolute;
  left: .7rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  pointer-events: none;
}

.rel-person-search {
  width: 100%;
  padding: .55rem .75rem .55rem 2.2rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: .9rem;
  font-family: var(--font);
  color: var(--text);
  background: var(--surface-2);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.rel-person-search:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
  background: var(--surface);
}

/* ── Scrollable person pick list ────────────────────────────── */
.rel-person-list {
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 0;
}

.rel-person-list::-webkit-scrollbar { width: 5px; }
.rel-person-list::-webkit-scrollbar-track { background: transparent; }
.rel-person-list::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }

.rel-person-option {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .55rem .75rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.rel-person-option:last-child { border-bottom: none; }

.rel-person-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0; height: 0;
}

.rel-person-option:hover { background: var(--color-primary-l); }

.rel-person-option.selected {
  background: var(--color-primary-l);
  border-left: 3px solid var(--color-primary);
}

.rel-person-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .75rem;
  flex-shrink: 0;
  text-transform: uppercase;
  background: #e2e8f0;
  color: #475569;
  user-select: none;
}
.rel-person-avatar[data-gender="M"]     { background: #dbeafe; color: #1d4ed8; }
.rel-person-avatar[data-gender="F"]     { background: #fce7f3; color: #9d174d; }
.rel-person-avatar[data-gender="Other"] { background: #ede9fe; color: #6d28d9; }
img.rel-person-avatar { object-fit: cover; display: block; }

.rel-person-option-name {
  font-size: .9rem;
  font-weight: 500;
  color: var(--text);
  flex: 1;
}

.rel-no-results {
  font-size: .875rem;
  color: var(--text-muted);
  padding: .75rem;
}

.rel-add-actions {
  display: flex;
  margin-top: 1.25rem;
}

/* ── Person picker – name + meta layout ─────────────────── */
.rel-person-option-info {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  flex: 1;
  min-width: 0;
}

.rel-person-option-name {
  font-size: .9rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rel-person-option-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .25rem;
  font-size: .72rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.rel-person-meta-sep {
  color: var(--text-light);
  font-size: .7rem;
}

.rel-person-id {
  font-family: "SFMono-Regular", "Consolas", "Courier New", monospace;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .06em;
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: .05rem .3rem;
  color: var(--text-muted);
}

/* ── BREADCRUMB ──────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .25rem;
  font-size: .82rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.breadcrumb-item { color: var(--color-primary); text-decoration: none; }
.breadcrumb-item:hover { text-decoration: underline; }
.breadcrumb-sep { color: var(--text-light); }
.breadcrumb-current { color: var(--text-muted); font-weight: 600; }

/* ── PAGINATION ──────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 1.5rem;
  padding: .75rem 0;
}
.pagination-info { font-size: .85rem; color: var(--text-muted); }
.pagination-controls { display: flex; gap: .3rem; flex-wrap: wrap; }
.pagination-current { pointer-events: none; }

/* ── DASHBOARD ───────────────────────────────────────────── */
.dash-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.dash-title    { font-size: 1.6rem; font-weight: 800; color: var(--text); }
.dash-subtitle { font-size: .95rem; color: var(--text-muted); margin-top: .25rem; }
.dash-header-actions { display: flex; gap: .5rem; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}
.stat-icon { font-size: 1.6rem; line-height: 1; }
.stat-value { font-size: 1.8rem; font-weight: 800; color: var(--text); line-height: 1; }
.stat-label { font-size: .78rem; color: var(--text-muted); margin-top: .15rem; }
.stat-icon-blue   { filter: none; }
.stat-icon-green  { filter: none; }
.stat-icon-gray   { filter: none; }
.stat-icon-pink   { filter: none; }
.stat-icon-indigo { filter: none; }
.stat-icon-rose   { filter: none; }

.dash-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 700px) { .dash-two-col { grid-template-columns: 1fr; } }
.card-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.card-section-header h2 { margin: 0; }

.dash-person-list { list-style: none; display: flex; flex-direction: column; gap: .5rem; }
.dash-person-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .5rem;
  border-radius: var(--radius-sm);
  transition: background .15s;
}
.dash-person-row:hover { background: var(--surface-2); }
.dash-person-info { flex: 1; min-width: 0; }
.dash-person-name { font-weight: 600; color: var(--text); text-decoration: none; font-size: .9rem; }
.dash-person-name:hover { color: var(--color-primary); }
.dash-person-meta { font-size: .75rem; color: var(--text-muted); display: block; }

.birthday-badge {
  background: #fef3c7;
  color: #92400e;
  font-size: .72rem;
  font-weight: 700;
  padding: .2rem .55rem;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}

.quick-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: .75rem;
}
.quick-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  padding: 1rem .5rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  font-size: .85rem;
  font-weight: 600;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.quick-link:hover { border-color: var(--color-primary); background: var(--color-primary-l); color: var(--color-primary); }
.ql-icon { font-size: 1.6rem; }

/* ── TIMELINE ────────────────────────────────────────────── */
.timeline-wrap { position: relative; padding-left: 2.5rem; }
.timeline-wrap::before {
  content: '';
  position: absolute;
  left: .95rem;
  top: 0; bottom: 0;
  width: 2px;
  background: var(--border);
}
.tl-year-group { margin-bottom: 2rem; }
.tl-year-label {
  position: relative;
  left: -2.5rem;
  display: inline-block;
  background: var(--color-primary);
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
  padding: .2rem .65rem;
  border-radius: 20px;
  margin-bottom: .75rem;
  letter-spacing: .04em;
}
.tl-events { display: flex; flex-direction: column; gap: .75rem; }
.tl-event {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  position: relative;
}
.tl-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: .25rem;
  position: absolute;
  left: -2.1rem;
  border: 2px solid var(--surface);
}
.tl-event-birth .tl-dot  { background: #10b981; }
.tl-event-death .tl-dot  { background: #94a3b8; }
.tl-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .65rem 1rem;
  flex: 1;
  box-shadow: var(--shadow-sm);
}
.tl-event-header { display: flex; align-items: center; gap: .5rem; margin-bottom: .4rem; }
.tl-badge {
  font-size: .7rem;
  font-weight: 700;
  padding: .15rem .5rem;
  border-radius: 20px;
}
.tl-badge-birth { background: #d1fae5; color: #065f46; }
.tl-badge-death { background: #f1f5f9; color: #475569; }
.tl-date { font-size: .78rem; color: var(--text-muted); }
.tl-person { display: flex; align-items: center; gap: .6rem; }
.tl-person-name { font-weight: 600; color: var(--text); text-decoration: none; font-size: .9rem; }
.tl-person-name:hover { color: var(--color-primary); }

/* ── STATS ───────────────────────────────────────────────── */
.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}
.chart-grid-wide { grid-template-columns: 1fr; }
.chart-card h2 { margin-bottom: 1rem; }
.chart-wrap { position: relative; max-height: 260px; }
.chart-legend { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; font-size: .8rem; margin-top: .75rem; color: var(--text-muted); }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }

.surname-list { list-style: none; display: flex; flex-direction: column; gap: .5rem; }
.surname-row  { display: flex; align-items: center; gap: .75rem; font-size: .88rem; }
.surname-name { min-width: 100px; font-weight: 600; }
.surname-bar-wrap { flex: 1; background: var(--surface-2); border-radius: 4px; height: 10px; overflow: hidden; }
.surname-bar { height: 100%; background: var(--color-primary); border-radius: 4px; min-width: 4px; }
.surname-count { min-width: 24px; text-align: right; color: var(--text-muted); font-weight: 700; font-size: .82rem; }
.stat-highlight { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; font-size: .88rem; }

/* ── SEARCH HERO ─────────────────────────────────────────── */
.search-hero { margin-bottom: 1.5rem; }
.search-hero-inner {
  display: flex;
  align-items: center;
  gap: .75rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  padding: .6rem 1rem;
  box-shadow: var(--shadow);
}
.search-hero-icon { color: var(--text-light); flex-shrink: 0; }
.search-hero-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1.05rem;
  background: transparent;
  color: var(--text);
}

/* ── RELATIONSHIP FINDER ─────────────────────────────────── */
.rf-form { }
.rf-selectors {
  display: grid;
  align-items: start;
}
.rf-selector { display: flex; flex-direction: column; gap: .5rem; }
.rf-label { font-weight: 700; font-size: .88rem; color: var(--text-muted); }
.rf-arrow { font-size: 2rem; color: var(--text-light); align-self: center; text-align: center; }
.rf-person-list {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-height: 240px;
  overflow-y: auto;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  z-index: 10;
}
.rf-selected-chip {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .5rem .75rem;
  background: var(--color-primary-l);
  border: 1px solid var(--color-primary);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .9rem;
  color: var(--color-primary);
}

.rf-path {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  padding: 1rem 0;
}
.rf-path-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  text-align: center;
}
.rf-node-name {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  max-width: 90px;
  word-break: break-word;
}
.rf-node-name:hover { color: var(--color-primary); }
.rf-path-step { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.rf-path-connector { display: flex; flex-direction: column; align-items: center; gap: .2rem; }
.rf-rel-label {
  font-size: .68rem;
  font-weight: 700;
  background: #ede9fe;
  color: #6d28d9;
  padding: .1rem .45rem;
  border-radius: 20px;
  white-space: nowrap;
}
.rf-arrow-line { font-size: 1.2rem; color: var(--text-light); }

/* ── EMPTY STATE ─────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

/* ── ALERT ───────────────────────────────────────────────── */
.alert { padding: .85rem 1.1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: .9rem; }
.alert-danger { background: var(--color-danger-l); border: 1px solid #fca5a5; color: #991b1b; }

.rel-gender-pill {
  margin-left: auto;
  flex-shrink: 0;
  align-self: center;
}

/* ── API Login Page ──────────────────────────────────────────── */
.api-login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding: 2rem;
}
.api-login-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,.08);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 380px;
  text-align: center;
}
.api-login-icon { font-size: 2.5rem; margin-bottom: .75rem; }
.api-login-title { font-size: 1.5rem; font-weight: 700; margin: 0 0 .4rem; }
.api-login-sub   { font-size: .9rem; color: var(--text-muted, #64748b); margin-bottom: 1.5rem; }
.api-login-form  { text-align: left; }
.btn-block       { width: 100%; margin-top: .25rem; }

/* ── Relationship Finder – Kinship Banner ──────────────────────────────── */
.rf-kinship-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--primary-light, #eff6ff);
  border: 1px solid var(--primary, #3b82f6);
  border-radius: 10px;
  padding: .9rem 1.25rem;
  margin-bottom: 1.5rem;
}
.rf-kinship-icon { font-size: 1.6rem; flex-shrink: 0; }
.rf-kinship-text { display: flex; align-items: baseline; flex-wrap: wrap; gap: .35rem; font-size: 1.05rem; }
.rf-kinship-a,
.rf-kinship-b    { font-weight: 700; color: var(--text, #1e293b); }
.rf-kinship-rel  {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--primary, #3b82f6);
  background: var(--primary-bg, #dbeafe);
  padding: .1rem .55rem;
  border-radius: 6px;
}
.rf-kinship-of   { color: var(--text-muted, #64748b); font-size: .9rem; }
