:root {
  color-scheme: light;
  --bg: #f4f1eb;
  --surface: #fffaf2;
  --surface-strong: #ffffff;
  --ink: #26211c;
  --muted: #746b61;
  --line: #ded4c6;
  --accent: #b6422d;
  --accent-dark: #883120;
  --green: #2f7352;
  --blue: #2f6288;
  --gender-male-color: #2374a6;
  --gender-male-bg: #f2f8ff;
  --gender-female-color: #d95b89;
  --gender-female-bg: #fff3f7;
  --gender-male-soft: #8dbdf0;
  --gender-female-soft: #f2a6bf;
  --family-line-green: #6aa46c;
  --family-line-brown: #9d8a77;
  --family-line-blue: #68a8bd;
  --family-line-action: #b9a99a;
  --card-glow-male: rgba(91, 152, 226, 0.16);
  --card-glow-female: rgba(217, 91, 137, 0.15);
  --gender-unknown-bg: linear-gradient(180deg, var(--gender-male-bg) 0 50%, var(--gender-female-bg) 50% 100%);
  --gender-unknown-stripe: linear-gradient(180deg, var(--gender-male-color) 0 50%, var(--gender-female-color) 50% 100%);
  --shadow: 0 16px 48px rgba(60, 45, 28, 0.12);
  --empty-state-image: url("https://www.ctcadventures.com/Upload/Blog/find-your-roots-detail.jpg");
  --editor-antique-bg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='720' height='480' viewBox='0 0 720 480'%3E%3Cdefs%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.72' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='.25 0 0 0 0.76 0 .23 0 0 0.64 0 0 .18 0 0.48 0 0 0 .2 0'/%3E%3C/filter%3E%3ClinearGradient id='paper' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop stop-color='%23fff9ec'/%3E%3Cstop offset='.45' stop-color='%23f6ecd9'/%3E%3Cstop offset='1' stop-color='%23fffaf1'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect width='720' height='480' fill='url(%23paper)'/%3E%3Crect width='720' height='480' filter='url(%23n)' opacity='.16'/%3E%3Cg fill='none' stroke='%23b98c6e' stroke-linecap='round' opacity='.13'%3E%3Cpath d='M42 90c58-44 112-44 162 0s104 44 162 0 112-44 162 0 104 44 162 0' stroke-width='4'/%3E%3Cpath d='M20 248c70-52 134-52 192 0s122 52 192 0 134-52 192 0' stroke-width='3'/%3E%3Cpath d='M92 382c48-34 96-34 144 0s96 34 144 0 96-34 144 0' stroke-width='3'/%3E%3C/g%3E%3Cg fill='%23b6422d' opacity='.045'%3E%3Ccircle cx='98' cy='148' r='48'/%3E%3Ccircle cx='622' cy='318' r='62'/%3E%3C/g%3E%3C/svg%3E");
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}

button:hover {
  background: var(--accent-dark);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-strong);
  color: var(--ink);
  padding: 10px 11px;
  outline: none;
}

textarea {
  min-height: 96px;
  line-height: 1.5;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(182, 66, 45, 0.14);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

fieldset {
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
}

.choice-field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.gender-radio-group,
.person-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.radio-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: auto;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--ink);
  padding: 0 13px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.radio-pill input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--accent);
}

.radio-pill:has(input:checked) {
  border-color: rgba(182, 66, 45, 0.58);
  background: rgba(182, 66, 45, 0.1);
  color: var(--accent-dark);
}

.radio-pill:has(input:focus-visible) {
  outline: 3px solid rgba(182, 66, 45, 0.18);
  outline-offset: 2px;
}

.person-radio-pill {
  max-width: 100%;
}

.person-radio-pill span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.sidebar {
  border-right: 1px solid var(--line);
  background: #eee5d8;
  padding: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.language-switcher {
  display: block;
  margin-bottom: 10px;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 8px;
  background: #fffaf2;
  box-shadow: 0 8px 20px rgba(136, 49, 32, 0.16);
  overflow: hidden;
}

.brand-logo-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand h1,
.brand p,
.workspace-header h2,
.panel h2,
.panel h3,
.empty-state h3 {
  margin: 0;
}

.workspace-header h2 {
  font-size: 24px;
  font-weight: 850;
  line-height: 1.25;
  color: var(--accent-dark);
  max-width: 760px;
  overflow-wrap: anywhere;
}

.brand p,
.field-hint,
.empty-state p,
.eyebrow {
  color: var(--muted);
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.sidebar .panel {
  padding: 13px;
  margin-top: 12px;
  box-shadow: none;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.sidebar .panel-heading {
  margin-bottom: 10px;
}

.panel-heading-actions {
  display: flex;
  gap: 4px;
}

.user-panel-actions {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
}

.sidebar .panel h2 {
  font-size: 17px;
  line-height: 1.2;
}

.family-create-row {
  display: block;
}

.sidebar .panel button {
  width: 48px;
  min-height: 28px;
  padding: 0 6px;
  font-size: 11px;
  white-space: nowrap;
}

.sidebar .panel .login-button {
  justify-self: center;
  width: min(190px, 100%);
  min-height: 30px;
  padding: 0 12px;
  font-size: 13px;
}

.sidebar .panel input,
.sidebar .panel select {
  padding: 8px 9px;
  font-size: 13px;
}

.sidebar .panel label {
  gap: 5px;
  font-size: 12px;
}

.focus-control {
  display: grid;
  grid-template-columns: auto minmax(180px, 260px);
  align-items: center;
  gap: 8px;
}

.focus-control select {
  min-width: 0;
}

.stack {
  display: grid;
  gap: 13px;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  gap: 6px;
  min-width: 0;
}

.ghost-button {
  min-height: 28px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--accent);
  padding: 0 6px;
}

.ghost-button:hover {
  background: rgba(182, 66, 45, 0.1);
  color: var(--accent-dark);
}

.current-user {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 12px;
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}

.current-user::before {
  content: "";
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background-color: var(--accent);
  -webkit-mask:
    radial-gradient(circle at 50% 31%, #000 0 26%, transparent 27%),
    radial-gradient(ellipse at 50% 93%, #000 0 48%, transparent 49%);
  -webkit-mask-repeat: no-repeat;
  mask:
    radial-gradient(circle at 50% 31%, #000 0 26%, transparent 27%),
    radial-gradient(ellipse at 50% 93%, #000 0 48%, transparent 49%);
  mask-repeat: no-repeat;
  opacity: 0.82;
}

.current-user.gender-male::before {
  background-color: var(--gender-male-color);
}

.current-user.gender-female::before {
  background-color: var(--gender-female-color);
}

.current-user.gender-unknown::before {
  background: var(--gender-unknown-stripe);
}

.current-user:hover {
  border-color: var(--accent);
  background: rgba(182, 66, 45, 0.08);
}

.current-user-line {
  display: block;
  min-width: 0;
  width: 100%;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.current-user.gender-male {
  border-left: 6px solid var(--gender-male-color);
  background: var(--gender-male-bg);
  color: #174e73;
}

.current-user.gender-female {
  border-left: 6px solid var(--gender-female-color);
  background: var(--gender-female-bg);
  color: #9b315a;
}

.current-user.gender-unknown {
  border-left: 6px solid transparent;
  background: var(--gender-unknown-bg);
  color: var(--ink);
}

.claim-block {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.claim-block .panel-heading {
  margin-bottom: 10px;
}

.family-list {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.family-select {
  display: none;
}

.family-list-items {
  display: grid;
  gap: 12px;
}

.clan-family-group {
  position: relative;
  display: grid;
  gap: 10px;
  border-radius: 8px;
  padding: 0 0 4px;
}

.clan-list-heading {
  position: relative;
  z-index: 1;
  justify-self: stretch;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  max-width: 100%;
  min-height: 42px;
  border: 1px solid rgba(182, 66, 45, 0.42);
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  background: var(--surface);
  color: var(--accent-dark);
  padding: 8px 14px 8px 11px;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  box-sizing: border-box;
  cursor: pointer;
  box-shadow: none;
}

.clan-list-heading:hover {
  border-color: rgba(182, 66, 45, 0.48);
  border-left-color: var(--accent-dark);
  background: rgba(182, 66, 45, 0.08);
  color: var(--accent-dark);
}

.clan-list-heading.active {
  border-color: rgba(182, 66, 45, 0.56);
  border-left-color: var(--accent-dark);
  background: var(--surface);
  color: var(--accent-dark);
}

.sidebar .panel .clan-list-heading {
  width: 100%;
  min-height: 42px;
  padding: 8px 14px 8px 11px;
  font-size: 14px;
  white-space: normal;
}

.family-item {
  display: grid;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 7px 10px;
  cursor: pointer;
}

.family-item:hover {
  border-color: rgba(182, 66, 45, 0.42);
  background: var(--surface-strong);
  color: var(--ink);
  box-shadow: 0 8px 18px rgba(60, 45, 28, 0.08);
}

.family-item-child {
  position: relative;
  margin-left: 0;
  background: rgba(255, 255, 255, 0.82);
}

.family-item-child:not(.active) {
  border-color: rgba(222, 212, 198, 0.82);
}

.family-item-text {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.family-name-line {
  display: block;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.family-detail-line {
  display: block;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 48%;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.family-item .family-detail-line {
  font-size: 11px;
  line-height: 1.2;
}

.family-item.active {
  border-color: var(--accent);
}

.workspace {
  padding: 26px;
  min-width: 0;
}

.workspace-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 10px;
  margin-bottom: 18px;
}

.workspace-title-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
}

.workspace-header.no-family-badge .workspace-title-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.stats::before {
  content: "";
  display: block;
  width: 40px;
  height: 100%;
  min-height: 40px;
}

.family-surname-badge {
  display: grid;
  grid-column: 1;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 8px;
  background: #bd3f2b;
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  box-shadow: 0 6px 18px rgba(136, 49, 32, 0.16);
  white-space: nowrap;
}

.family-surname-badge.two-character-badge {
  font-size: 17px;
}

.workspace-title-row h2 {
  grid-column: 2;
}

.workspace-title-row .workspace-family-actions {
  grid-column: 3;
}

.workspace-header.no-family-badge .workspace-title-row h2 {
  grid-column: 1;
}

.workspace-header.no-family-badge .workspace-family-actions {
  grid-column: 2;
}

.workspace-family-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.workspace-family-actions .ghost-button {
  min-height: 30px;
  padding: 0 12px;
  font-size: 12px;
}

.eyebrow {
  margin: 0 0 5px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.stats {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
}

.stats::before {
  flex: 0 0 40px;
  visibility: hidden;
}

.workspace-header.no-family-badge .stats::before {
  display: none;
}

.stats-inline {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.empty-state {
  display: grid;
  min-height: calc(100vh - 52px);
  align-content: start;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(20, 15, 10, 0.18) 0%, rgba(20, 15, 10, 0.48) 54%, rgba(20, 15, 10, 0.82) 100%),
    var(--empty-state-image) center / cover no-repeat;
  padding: min(8vw, 72px);
  color: #fffaf2;
  box-shadow: inset 0 -160px 180px rgba(0, 0, 0, 0.28);
}

.empty-state h3 {
  max-width: 760px;
  color: #fffaf2;
  font-size: clamp(38px, 7vw, 82px);
  font-weight: 900;
  line-height: 1.02;
  text-align: left;
  text-shadow: 0 8px 30px rgba(0, 0, 0, 0.42);
}

.empty-state p {
  max-width: 560px;
  margin: 16px 0 0;
  color: rgba(255, 250, 242, 0.88);
  font-size: clamp(16px, 2.1vw, 22px);
  font-weight: 700;
  line-height: 1.45;
  text-align: left;
  text-shadow: 0 6px 22px rgba(0, 0, 0, 0.38);
}

.app-footer {
  display: grid;
  justify-items: center;
  gap: 8px;
  border-top: 1px solid rgba(222, 212, 198, 0.86);
  margin-top: 24px;
  padding: 18px 12px 4px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
}

.footer-links a,
.footer-links button {
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--accent);
  padding: 0;
  font-size: inherit;
  font-weight: 800;
  text-decoration: none;
}

.footer-links a:hover,
.footer-links button:hover {
  background: transparent;
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.app-footer p {
  margin: 0;
  line-height: 1.5;
}

.help-shell {
  min-height: 100vh;
  background: linear-gradient(180deg, #f4eee4 0%, #fbf7ef 42%, #fffaf2 100%);
  color: var(--ink);
  padding: clamp(18px, 4vw, 42px);
}

.help-hero,
.help-layout,
.help-footer {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.help-hero {
  display: grid;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding: 12px 0 24px;
}

.help-back-link,
.help-footer a {
  color: var(--accent);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.help-back-link:hover,
.help-footer a:hover {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.help-title-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.help-brand-mark {
  display: inline-grid;
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 14px;
  background: #fffaf2;
  box-shadow: 0 10px 24px rgba(136, 49, 32, 0.16);
  overflow: hidden;
}

.help-kicker {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 900;
}

.help-hero h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.15;
}

.help-intro {
  max-width: calc(100% - 74px);
  margin: 0 0 0 74px;
  color: var(--muted);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.7;
  overflow-wrap: break-word;
}

.help-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 22px;
  padding-top: 22px;
}

.help-toc {
  position: sticky;
  top: 18px;
  display: grid;
  align-self: start;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.84);
  padding: 12px;
}

.help-toc a {
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  padding: 9px 10px;
  text-decoration: none;
}

.help-toc a:hover {
  background: rgba(188, 59, 40, 0.1);
  color: var(--accent);
}

.help-content {
  display: grid;
  gap: 16px;
}

.help-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.9);
  padding: clamp(18px, 3vw, 28px);
  box-shadow: 0 14px 36px rgba(50, 36, 24, 0.06);
}

.help-card h2 {
  margin: 0 0 12px;
  color: var(--accent-dark);
  font-size: 24px;
}

.help-card h3 {
  margin: 0 0 6px;
  font-size: 17px;
}

.help-card p,
.help-card li {
  color: var(--muted);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.75;
}

.help-card p {
  margin: 0 0 12px;
}

.help-card p:last-child {
  margin-bottom: 0;
}

.help-card ol,
.help-card ul {
  margin: 0;
  padding-left: 22px;
}

.help-rule-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.help-rule-grid > div {
  border: 1px solid rgba(222, 212, 198, 0.9);
  border-radius: 8px;
  background: rgba(244, 238, 228, 0.52);
  padding: 14px;
}

.help-flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: stretch;
  gap: 10px;
  margin: 16px 0;
}

.help-flow-item {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(188, 59, 40, 0.22);
  border-radius: 8px;
  background: #fff7f4;
  padding: 14px;
}

.help-flow-item strong {
  color: var(--accent-dark);
  font-size: 17px;
}

.help-flow-item span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.6;
}

.help-flow-arrow {
  display: grid;
  place-items: center;
  color: var(--accent);
  font-size: 22px;
  font-weight: 900;
}

.help-lineage {
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  background: #224569;
  color: #fffaf2;
  margin: 4px 0 14px;
  padding: 10px 14px;
  font-size: 19px;
  font-weight: 900;
}

.help-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  border-top: 1px solid var(--line);
  margin-top: 26px;
  padding-top: 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.family-workspace {
  display: grid;
  gap: 18px;
}

.data-loading-state {
  min-height: min(520px, calc(100vh - 190px));
  display: grid;
  place-items: center;
  border: 1px solid rgba(222, 212, 198, 0.9);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.9), rgba(255, 250, 242, 0.72) 38%, rgba(244, 241, 235, 0.92) 100%);
  padding: 28px;
}

.data-loading-card {
  width: min(420px, calc(100vw - 48px));
  display: grid;
  justify-items: center;
  gap: 14px;
  border: 1px solid rgba(222, 212, 198, 0.92);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.96);
  box-shadow: 0 22px 60px rgba(60, 45, 28, 0.12);
  padding: 30px 30px 28px;
  text-align: center;
}

.data-loading-copy {
  display: grid;
  gap: 6px;
  justify-items: center;
}

.data-loading-copy strong {
  color: #7b2e21;
  font-size: 19px;
  font-weight: 850;
  line-height: 1.25;
}

.data-loading-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
}

.data-loading-card small {
  color: #6c6258;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.45;
  animation: data-loading-text 2.2s ease-in-out infinite;
}

.data-loading-scene {
  position: relative;
  width: 188px;
  height: 108px;
}

.data-loading-orbit {
  position: absolute;
  left: 54px;
  top: 14px;
  width: 80px;
  height: 80px;
  border: 1px solid rgba(182, 66, 45, 0.18);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 250, 242, 0.6) 0%, rgba(182, 66, 45, 0.06) 58%, rgba(182, 66, 45, 0) 72%);
  animation: data-loading-orbit 2.6s ease-in-out infinite;
}

.data-loading-seal {
  position: absolute;
  left: 71px;
  top: 31px;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(136, 49, 32, 0.26);
  border-radius: 8px;
  background: #fffaf2;
  box-shadow: 0 14px 30px rgba(60, 45, 28, 0.14);
  overflow: hidden;
  animation: data-loading-seal 2.6s ease-in-out infinite;
}

.data-loading-seal::before {
  content: none;
}

.data-loading-thread {
  position: absolute;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(116, 107, 97, 0), rgba(116, 107, 97, 0.48), rgba(116, 107, 97, 0));
  transform-origin: left center;
  animation: data-loading-thread 2.6s ease-in-out infinite;
}

.data-loading-thread.thread-one {
  left: 23px;
  top: 54px;
  width: 54px;
}

.data-loading-thread.thread-two {
  left: 111px;
  top: 54px;
  width: 54px;
  animation-delay: 0.18s;
}

.data-loading-thread.thread-three {
  left: 67px;
  top: 87px;
  width: 54px;
  transform: rotate(90deg);
  animation-delay: 0.36s;
}

.data-loading-dot {
  position: absolute;
  width: 9px;
  height: 9px;
  border: 2px solid #fffaf2;
  border-radius: 50%;
  background: rgba(182, 66, 45, 0.86);
  box-shadow: 0 7px 16px rgba(60, 45, 28, 0.14);
  animation: data-loading-dot 2.6s ease-in-out infinite;
}

.data-loading-dot.dot-one {
  left: 17px;
  top: 50px;
}

.data-loading-dot.dot-two {
  right: 17px;
  top: 50px;
  animation-delay: 0.18s;
}

.data-loading-dot.dot-three {
  left: 89px;
  bottom: 6px;
  animation-delay: 0.36s;
}

.data-loading-progress {
  width: min(240px, 100%);
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(222, 212, 198, 0.72);
}

.data-loading-progress span {
  display: block;
  width: 46%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(136, 49, 32, 0), rgba(182, 66, 45, 0.88), rgba(136, 49, 32, 0));
  animation: data-loading-progress 1.6s ease-in-out infinite;
}

@keyframes data-loading-orbit {
  0%,
  100% {
    opacity: 0.48;
    transform: scale(0.96);
  }
  50% {
    opacity: 0.86;
    transform: scale(1.04);
  }
}

@keyframes data-loading-seal {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-2px);
  }
}

@keyframes data-loading-thread {
  0%,
  100% {
    opacity: 0.32;
    clip-path: inset(0 48% 0 48%);
  }
  50% {
    opacity: 0.9;
    clip-path: inset(0 0 0 0);
  }
}

@keyframes data-loading-dot {
  0%,
  100% {
    opacity: 0.56;
    transform: scale(0.92);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

@keyframes data-loading-text {
  0%,
  100% {
    opacity: 0.62;
  }
  50% {
    opacity: 1;
  }
}

@keyframes data-loading-progress {
  0% {
    transform: translateX(-115%);
  }
  100% {
    transform: translateX(250%);
  }
}

.top-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.95fr) minmax(260px, 0.95fr) minmax(300px, 1.1fr);
  gap: 14px;
}

.top-grid .panel,
.content-grid .panel {
  padding: 16px;
}

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

.field-hint {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.graph-panel {
  order: 1;
  min-height: 0;
}

.family-directory-page {
  order: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.family-directory-page.hidden {
  display: none;
}

.directory-tree-panel {
  min-width: 0;
  background:
    linear-gradient(rgba(255, 250, 242, 0.74), rgba(255, 250, 242, 0.74)),
    var(--editor-antique-bg) center / cover;
}

.directory-tree-panel h3 {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 17px;
}

.directory-generation-list {
  display: grid;
  gap: 16px;
  max-height: none;
  overflow: visible;
  padding-right: 4px;
}

.directory-lineage-list {
  gap: 12px;
}

.directory-clan-section {
  background: rgba(255, 250, 242, 0.78);
}

.directory-clan-section .directory-level-title {
  flex-wrap: wrap;
}

.directory-menu-person-button {
  min-height: 54px;
}

.directory-menu-person-button .directory-toggle-title {
  font-size: 15px;
}

.directory-clan-root-button {
  width: calc(100% - var(--directory-level-indent));
  min-height: 50px;
  margin-left: var(--directory-level-indent);
}

.directory-lineage-section,
.directory-sub-branch,
.directory-world-section {
  display: grid;
  gap: 7px;
}

.directory-lineage-section {
  --directory-level-indent: 46px;
  border: 1px solid rgba(224, 205, 190, 0.82);
  border-radius: 14px;
  background:
    linear-gradient(rgba(255, 250, 242, 0.82), rgba(255, 250, 242, 0.82)),
    var(--editor-antique-bg) center / cover;
  padding: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86), 0 14px 34px rgba(83, 64, 43, 0.08);
}

.directory-house-section {
  padding-left: 12px;
}

.directory-sub-branch-list {
  gap: 10px;
  border-left: 1px solid rgba(106, 164, 108, 0.32);
  margin-left: var(--directory-level-indent);
  padding-left: 12px;
}

.directory-sub-branch {
  border-radius: 12px;
  background: rgba(255, 250, 242, 0.42);
  padding: 9px 0 9px 10px;
}

.directory-world-list {
  display: grid;
  gap: 8px;
  border-left: 1px solid rgba(104, 168, 189, 0.28);
  margin-left: var(--directory-level-indent);
  padding-left: 12px;
}

.directory-world-section {
  gap: 6px;
}

.directory-level-title,
.directory-world-title {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.directory-toggle-button {
  width: 100%;
  border: 1px solid rgba(222, 212, 198, 0.95);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 250, 242, 0.86));
  padding: 9px 11px;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(60, 45, 28, 0.06);
}

.directory-toggle-button:hover {
  border-color: rgba(182, 66, 45, 0.28);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 246, 237, 0.94));
  box-shadow: 0 10px 24px rgba(60, 45, 28, 0.08);
}

.directory-toggle-button.active {
  border-color: rgba(149, 184, 222, 0.8);
  background: linear-gradient(135deg, rgba(242, 248, 255, 0.96), rgba(255, 250, 242, 0.92));
  box-shadow:
    inset 0 0 0 1px rgba(121, 174, 230, 0.22),
    0 14px 30px rgba(91, 152, 226, 0.13);
}

.directory-static-title {
  cursor: default;
}

.directory-static-title:hover {
  border-color: rgba(222, 212, 198, 0.92);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 250, 242, 0.86));
}

.directory-toggle-title {
  display: inline;
  min-width: 0;
  color: rgba(116, 107, 97, 0.74);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.directory-toggle-structured-title {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}

.directory-toggle-title-prefix {
  color: rgba(116, 107, 97, 0.74);
}

.directory-toggle-title-name {
  color: var(--ink);
  font-weight: 900;
}

.directory-toggle-main {
  flex: 0 1 auto;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.directory-toggle-detail {
  flex: 0 1 auto;
  min-width: 0;
  color: rgba(116, 107, 97, 0.92);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.directory-toggle-person-meta {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}

.directory-toggle-detail-name {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.directory-toggle-detail-generation {
  color: var(--ink);
  font-size: inherit;
  font-weight: inherit;
}

.directory-menu-person-button .directory-toggle-detail {
  color: var(--ink);
}

.directory-toggle-stats {
  flex: 0 0 auto;
  color: #9a6a2e;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
  white-space: nowrap;
}

.directory-toggle-button:has(.directory-level-clan) .directory-toggle-stats {
  color: #b6422d;
}

.directory-toggle-button:has(.directory-level-house) .directory-toggle-stats {
  color: #d98222;
}

.directory-toggle-button:has(.directory-level-branch) .directory-toggle-stats {
  color: #5f8a4a;
}

.directory-toggle-button:has(.directory-level-world) .directory-toggle-stats {
  color: #3f6ea7;
}

.directory-toggle-mark {
  flex: 0 0 auto;
  margin-left: auto;
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(222, 212, 198, 0.92);
  border-radius: 999px;
  background: rgba(255, 250, 242, 0.88);
  color: rgba(116, 107, 97, 0.9);
  font-size: 19px;
  font-weight: 950;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.48);
}

.directory-toggle-button:hover .directory-toggle-mark {
  border-color: rgba(182, 66, 45, 0.38);
  background: rgba(182, 66, 45, 0.1);
  color: #7b2e21;
}

.directory-level-badge {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 24px;
  border-radius: 8px;
  color: #fff;
  padding: 0 7px;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.36), 0 6px 14px rgba(60, 45, 28, 0.08);
}

.directory-level-clan {
  background: #b6422d;
}

.directory-level-house {
  background: #d98222;
}

.directory-level-branch {
  background: #5f8a4a;
}

.directory-level-world {
  background: #3f6ea7;
}

.directory-person-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 9px;
  margin-left: var(--directory-level-indent);
}

.directory-clan-person-row {
  width: calc(100% - var(--directory-level-indent));
}

.directory-house-section > .directory-lineage-button,
.directory-sub-branch > .directory-lineage-button {
  width: calc(100% - var(--directory-level-indent));
  margin-left: var(--directory-level-indent);
}

.directory-lineage-button.directory-person-node {
  min-height: 50px;
  padding: 9px 11px;
}

.directory-person-copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 3px;
  min-width: 0;
}

.directory-lineage-button.directory-person-node strong {
  display: block;
  min-width: 0;
  color: inherit;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.18;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.directory-generation-section {
  display: grid;
  gap: 7px;
}

.directory-generation-section h4 {
  margin: 0;
  border-bottom: 1px solid rgba(222, 212, 198, 0.84);
  background: var(--surface);
  color: var(--accent-dark);
  padding: 3px 0 5px;
  font-size: 13px;
  font-weight: 900;
}

.directory-branch-list {
  display: grid;
  gap: 7px;
}

.directory-branch-button {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  width: 100%;
  min-height: 0;
  justify-items: start;
  column-gap: 8px;
  row-gap: 3px;
  border: 1px solid rgba(222, 212, 198, 0.95);
  border-left: 0;
  border-radius: 10px;
  background: #fbfaf8;
  color: var(--ink);
  padding: 9px 11px;
  text-align: left;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(60, 45, 28, 0.08);
}

.directory-branch-button:hover,
.directory-branch-button:focus {
  border-color: rgba(149, 184, 222, 0.72);
  background: rgba(255, 250, 242, 0.98);
  color: var(--ink);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(60, 45, 28, 0.1);
}

.directory-branch-button small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.directory-branch-button.active {
  background: #3f6ea7;
  color: #fffaf2;
}

.directory-branch-button.active::after {
  display: none;
}

.directory-branch-button.active:hover,
.directory-branch-button.active:focus {
  background: #3f6ea7;
  color: #fffaf2;
}

.directory-branch-button.gender-female.active:hover,
.directory-branch-button.gender-female.active:focus {
  background: #3f6ea7;
  color: #fffaf2;
}

.directory-branch-button.gender-unknown.active:hover,
.directory-branch-button.gender-unknown.active:focus {
  background: #3f6ea7;
  color: #fffaf2;
}

.directory-branch-button.gender-male {
  --avatar-bg: #dcebff;
  --avatar-fg: #4d8fd7;
  --avatar-shadow: rgba(76, 116, 159, 0.16);
  border-color: rgba(121, 174, 230, 0.72);
  background: var(--gender-male-bg);
}

.directory-branch-button.gender-female {
  --avatar-bg: #ffe0eb;
  --avatar-fg: #df628f;
  --avatar-shadow: rgba(203, 86, 126, 0.15);
  border-color: rgba(235, 167, 190, 0.72);
  background: var(--gender-female-bg);
}

.directory-branch-button.gender-unknown {
  --avatar-bg: linear-gradient(180deg, #dcebff 0 50%, #ffe0eb 50% 100%);
  --avatar-fg: #8374dc;
  --avatar-shadow: rgba(114, 99, 196, 0.14);
  border-left-color: transparent;
  background: var(--gender-unknown-bg);
}

.directory-branch-button.gender-male::before,
.directory-branch-button.gender-female::before,
.directory-branch-button.gender-unknown::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  background: var(--gender-unknown-stripe);
  pointer-events: none;
}

.directory-branch-button.gender-male::before {
  background: var(--gender-male-color);
}

.directory-branch-button.gender-female::before {
  background: var(--gender-female-color);
}

.directory-branch-button.gender-unknown::before {
  background: var(--gender-unknown-stripe);
}

.directory-branch-button.gender-male.active,
.directory-branch-button.gender-female.active {
  background: #3f6ea7;
}

.directory-branch-button.gender-female.active {
  background: #3f6ea7;
}

.directory-branch-button.gender-unknown.active {
  background: #3f6ea7;
}

.directory-branch-button.active strong,
.directory-branch-button.active small {
  color: #fffaf2;
}

.directory-person-avatar {
  grid-column: 1;
  grid-row: 1;
  width: 28px;
  height: 28px;
  color: var(--avatar-fg, #4d8fd7);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.62), 0 5px 10px var(--avatar-shadow, rgba(76, 116, 159, 0.14));
}

.directory-graph-panel {
  min-height: 0;
}

.directory-graph-panel .tree-view {
  min-height: 0;
}

.tree-view {
  position: relative;
  display: grid;
  gap: 16px;
  overflow-x: auto;
  overflow-y: visible;
  min-height: 0;
  --canvas-frame-gap: 14px;
  padding: var(--canvas-frame-gap);
}

.start-person-panel {
  display: grid;
  width: 100%;
  min-height: clamp(420px, calc(100vh - 310px), 680px);
  place-content: center;
  justify-self: stretch;
  align-self: stretch;
  gap: 18px;
  border: 1px dashed #c8b7a3;
  border-radius: 8px;
  background:
    linear-gradient(rgba(255, 250, 242, 0.78), rgba(255, 250, 242, 0.78)),
    var(--editor-antique-bg) center / cover;
  box-sizing: border-box;
  padding: clamp(22px, 4vw, 44px);
  text-align: center;
}

.start-person-panel button {
  justify-self: center;
  min-width: 180px;
}

.start-person-button {
  min-width: 220px;
  padding-left: 22px;
  padding-right: 22px;
}

.start-family-settings-button {
  min-width: 142px;
  min-height: 32px;
  border: 1px solid rgba(182, 66, 45, 0.46);
  background: rgba(255, 250, 242, 0.88);
  color: var(--accent);
  padding: 0 14px;
  font-size: 13px;
}

.start-family-settings-button:hover {
  border-color: var(--accent);
  background: rgba(182, 66, 45, 0.08);
  color: var(--accent-dark);
}

.pedigree-editor {
  display: grid;
  align-content: start;
  justify-items: start;
  width: 100%;
  min-width: 0;
}

.canvas-fit {
  position: relative;
  margin: 0;
}

.tree-canvas {
  position: relative;
  border: 1px solid rgba(224, 205, 190, 0.82);
  border-radius: 14px;
  transform-origin: top left;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.86), rgba(255, 250, 242, 0.5) 32%, transparent 58%),
    linear-gradient(rgba(255, 250, 242, 0.62), rgba(255, 250, 242, 0.62)),
    var(--editor-antique-bg),
    linear-gradient(rgba(190, 149, 116, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(80, 137, 177, 0.045) 1px, transparent 1px),
    #fffaf2;
  background-size: 100% 100%, 100% 100%, cover, 40px 40px, 40px 40px, auto;
  background-position: center, center, center, 0 0, 0 0, center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 18px 44px rgba(83, 64, 43, 0.08);
}

.family-lines {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.canvas-node-layer {
  position: absolute;
  inset: 0;
}

.family-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.spouse-line {
  stroke: rgba(106, 164, 108, 0.82);
  stroke-width: 1;
}

.sibling-line {
  stroke: rgba(182, 66, 45, 0.34);
  stroke-width: 1;
}

.sibling-group-line {
  stroke: rgba(182, 66, 45, 0.46);
  stroke-width: 1;
}

.parent-line {
  stroke: rgba(157, 138, 119, 0.78);
  stroke-width: 1;
}

.action-line {
  stroke: rgba(185, 169, 154, 0.86);
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
}

.family-joint {
  fill: #b79481;
  stroke: #fffaf2;
  stroke-width: 0.75;
}

.canvas-node {
  position: absolute;
  z-index: 2;
}

.person-node {
  display: grid;
  width: 230px;
  justify-items: center;
}

.person-node:has(.focus-relation-menu) {
  width: 486px;
  grid-template-columns: 230px 250px;
  align-items: start;
  justify-items: stretch;
  gap: 6px;
}

.person-node .person-card {
  width: 100%;
  box-sizing: border-box;
  height: 100%;
  min-height: 118px;
  box-shadow: 0 12px 30px rgba(60, 45, 28, 0.12);
}

.compact-node .person-card {
  grid-template-columns: 22px minmax(0, 1fr);
  column-gap: 6px;
  min-height: inherit;
  padding: 9px 11px;
}

.compact-node .person-card h4 {
  font-size: 15px;
}

.compact-node .person-avatar {
  width: 22px;
  height: 22px;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.5), 0 5px 12px rgba(76, 116, 159, 0.14);
}

.grandparent-node .person-card h4 {
  font-size: 13px;
}

.focus-person-node .person-card {
  grid-template-columns: 52px minmax(0, 1fr);
  column-gap: 12px;
  width: 100%;
  min-height: 136px;
  padding: 20px 22px;
  border-color: rgba(121, 174, 230, 0.78);
  background: var(--gender-male-bg);
  box-shadow: 0 12px 28px rgba(70, 116, 170, 0.12);
}

.focus-person-node .person-avatar {
  width: 52px;
  height: 52px;
  box-shadow: inset 0 0 0 5px rgba(255, 255, 255, 0.55), 0 10px 22px rgba(76, 116, 159, 0.18);
}

.focus-person-node::before,
.focus-person-node::after {
  content: none;
  position: absolute;
  top: 2px;
  width: 70px;
  height: 118px;
  z-index: 0;
  opacity: 0.9;
  pointer-events: none;
  background:
    radial-gradient(circle at 82% 14%, rgba(246, 205, 104, 0.82) 0 4%, transparent 4.8%),
    radial-gradient(circle at 18% 78%, rgba(190, 184, 177, 0.54) 0 3.5%, transparent 4.2%),
    radial-gradient(ellipse 12px 25px at 32% 22%, rgba(159, 205, 128, 0.9) 0 58%, transparent 60%),
    radial-gradient(ellipse 14px 27px at 58% 42%, rgba(124, 184, 100, 0.82) 0 57%, transparent 59%),
    radial-gradient(ellipse 13px 26px at 28% 56%, rgba(177, 217, 146, 0.86) 0 58%, transparent 60%),
    radial-gradient(ellipse 15px 29px at 67% 68%, rgba(143, 196, 111, 0.82) 0 56%, transparent 58%),
    radial-gradient(ellipse 9px 18px at 44% 80%, rgba(194, 226, 164, 0.86) 0 58%, transparent 60%),
    linear-gradient(118deg, transparent 0 42%, rgba(121, 172, 96, 0.5) 43% 46%, transparent 47% 100%);
  filter: drop-shadow(0 8px 12px rgba(102, 156, 84, 0.14));
}

.focus-person-node::before {
  left: -58px;
  transform: rotate(-17deg);
}

.focus-person-node::after {
  right: -58px;
  transform: scaleX(-1) rotate(-17deg);
}

.focus-person-node .person-card {
  position: relative;
  z-index: 1;
}

.relative-node {
  z-index: 3;
}

.sibling-label-node {
  position: absolute;
  display: grid;
  place-items: center;
  z-index: 3;
  border: 4px solid rgba(255, 250, 242, 0.96);
  border-radius: 999px;
  outline: 1px solid rgba(182, 66, 45, 0.18);
  background:
    radial-gradient(circle at 36% 28%, rgba(255, 255, 255, 0.78), transparent 36%),
    linear-gradient(135deg, #fff6f1 0%, #f7e5dc 58%, #efd3c7 100%);
  color: #8f3a2a;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  box-shadow:
    0 0 0 6px rgba(246, 226, 216, 0.22),
    0 14px 30px rgba(145, 64, 43, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
  pointer-events: none;
}

.sibling-label-node::before {
  content: "";
  position: absolute;
  inset: -7px;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(circle, rgba(244, 218, 205, 0.22), transparent 68%);
}

.sibling-label-node span {
  position: relative;
  z-index: 1;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.75);
}

.sibling-group-heading,
.spouse-group-heading {
  display: grid;
  place-items: center;
  z-index: 3;
  pointer-events: none;
}

.sibling-group-heading span,
.spouse-group-heading span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 116px;
  min-height: 30px;
  border: 2px solid rgba(182, 66, 45, 0.26);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 250, 242, 0.98), rgba(250, 232, 222, 0.94));
  color: #8f3a2a;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(145, 64, 43, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.sibling-group-heading span::before {
  content: "♧";
  margin-right: 6px;
  font-size: 15px;
}

.mini-person-card {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 6px;
  row-gap: 2px;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 1px solid rgba(222, 212, 198, 0.95);
  border-left: 0;
  border-radius: 9px;
  background: #fbfaf8;
  color: var(--ink);
  padding: 6px 9px;
  overflow: hidden;
  text-align: left;
  box-shadow: 0 10px 24px rgba(60, 45, 28, 0.08);
}

.mini-person-card.gender-male {
  --avatar-bg: #dcebff;
  --avatar-fg: #4d8fd7;
  --avatar-shadow: rgba(76, 116, 159, 0.16);
  border-color: rgba(121, 174, 230, 0.72);
  background: var(--gender-male-bg);
}

.mini-person-card.gender-female {
  --avatar-bg: #ffe0eb;
  --avatar-fg: #df628f;
  --avatar-shadow: rgba(203, 86, 126, 0.15);
  border-color: rgba(235, 167, 190, 0.72);
  background: var(--gender-female-bg);
}

.mini-person-card.gender-unknown {
  --avatar-bg: linear-gradient(180deg, #dcebff 0 50%, #ffe0eb 50% 100%);
  --avatar-fg: #8374dc;
  --avatar-shadow: rgba(114, 99, 196, 0.14);
  border-left-color: transparent;
  background: var(--gender-unknown-bg);
}

.mini-person-card.gender-male::before,
.mini-person-card.gender-female::before,
.mini-person-card.gender-unknown::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  background: var(--gender-unknown-stripe);
  pointer-events: none;
}

.mini-person-card.gender-male::before {
  background: var(--gender-male-color);
}

.mini-person-card.gender-female::before {
  background: var(--gender-female-color);
}

.mini-person-card::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.5), transparent 50%);
  pointer-events: none;
}

.mini-avatar {
  z-index: 1;
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  width: 18px;
  height: 18px;
}

.mini-person-card strong {
  grid-column: 2;
  grid-row: 1;
  align-self: end;
  display: block;
  min-width: 0;
  width: 100%;
  position: relative;
  z-index: 1;
  color: inherit;
  font-size: 16px;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-person-card > span {
  position: relative;
  z-index: 1;
  grid-column: 2;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.22;
}

.mini-person-card .person-card-details {
  grid-column: 2;
  grid-row: 2;
  align-self: start;
  justify-self: start;
  width: auto;
}

.mini-person-card .person-avatar {
  grid-column: 1;
  grid-row: 1 / span 2;
  color: var(--avatar-fg, #4d8fd7);
}

.mini-person-card:hover {
  transform: translateY(-1px);
}

.relative-node:has(.mini-person-card:not(.child-mini-person-card))::before {
  content: "♡ 配偶";
  position: absolute;
  left: 50%;
  top: -38px;
  z-index: 4;
  min-width: 76px;
  min-height: 28px;
  border: 2px solid rgba(235, 167, 190, 0.42);
  border-radius: 999px;
  background: rgba(255, 243, 247, 0.92);
  color: #c94f7c;
  padding: 5px 11px 4px;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(203, 86, 126, 0.1);
  transform: translateX(-50%);
  pointer-events: none;
}

.child-relation-node {
  z-index: 3;
}

.sibling-group-heading span::before {
  content: "\2667";
}

.spouse-group-heading span {
  border-color: rgba(235, 167, 190, 0.42);
  background: rgba(255, 243, 247, 0.92);
  color: #c94f7c;
  box-shadow: 0 8px 18px rgba(203, 86, 126, 0.1);
}

.spouse-group-heading span::before {
  content: "\2661";
  margin-right: 6px;
  font-size: 15px;
}

.relative-node:has(.mini-person-card:not(.child-mini-person-card))::before {
  display: none;
}

.focus-person-node::before,
.focus-person-node::after {
  top: -42px;
  width: 88px;
  height: 156px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='156' viewBox='0 0 88 156'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Ccircle cx='81' cy='12' r='6.5' fill='%23f6d077' opacity='.76'/%3E%3Ccircle cx='13' cy='118' r='6.5' fill='%23d8d0c8' opacity='.58'/%3E%3Cpath d='M72 134 C48 105 42 72 50 43 C54 28 63 17 75 8' stroke='%2394c56f' stroke-width='3.5' stroke-linecap='round' opacity='.72'/%3E%3Cpath d='M54 62 C42 53 28 51 12 55' stroke='%2394c56f' stroke-width='3.1' stroke-linecap='round' opacity='.64'/%3E%3Cpath d='M56 86 C41 79 27 79 9 86' stroke='%2394c56f' stroke-width='3.1' stroke-linecap='round' opacity='.58'/%3E%3Cellipse cx='66' cy='28' rx='9' ry='24' fill='%23b8dc99' opacity='.9' transform='rotate(-31 66 28)'/%3E%3Cellipse cx='41' cy='58' rx='10' ry='22' fill='%23a8d184' opacity='.9' transform='rotate(61 41 58)'/%3E%3Cellipse cx='20' cy='72' rx='10' ry='26' fill='%23badd9d' opacity='.86' transform='rotate(103 20 72)'/%3E%3Cellipse cx='63' cy='76' rx='9' ry='25' fill='%2399ca76' opacity='.88' transform='rotate(-25 63 76)'/%3E%3Cellipse cx='75' cy='104' rx='10' ry='26' fill='%23acd686' opacity='.82' transform='rotate(-47 75 104)'/%3E%3Cpath d='M64 26 C67 33 68 39 69 47 M42 58 C35 58 28 58 20 61 M20 72 C28 74 36 75 45 75 M64 78 C68 85 69 93 69 101 M74 104 C68 109 62 114 56 119' stroke='%2377ad5d' stroke-width='1.6' stroke-linecap='round' opacity='.36'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
  filter: drop-shadow(0 8px 10px rgba(102, 156, 84, 0.11));
}

.focus-person-node::before {
  left: -86px;
  transform: none;
}

.focus-person-node::after {
  right: -86px;
  transform: scaleX(-1);
}

.focus-person-node::before,
.focus-person-node::after {
  content: none;
  display: none;
  background: none;
}

.sibling-group-heading span::before {
  content: "";
  width: 18px;
  height: 18px;
  margin-right: 7px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='%238f3a2a' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='7.2' cy='7' r='2.7'/%3E%3Cpath d='M2.8 16c.5-3 2.1-4.8 4.4-4.8S11.1 13 11.6 16'/%3E%3Ccircle cx='13.2' cy='6.2' r='2.25' opacity='.8'/%3E%3Cpath d='M11.1 11.2c2.7.1 4.4 1.7 5 4.8' opacity='.8'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
  flex: 0 0 auto;
}

.sibling-label-node {
  background:
    radial-gradient(circle at 38% 30%, rgba(255, 255, 255, 0.88), transparent 38%),
    linear-gradient(135deg, #fff7f2 0%, #f7e5dc 56%, #efd2c6 100%);
  border-color: rgba(255, 250, 242, 0.98);
  outline-color: rgba(182, 66, 45, 0.18);
  color: #8f3a2a;
  box-shadow:
    0 0 0 6px rgba(246, 226, 216, 0.18),
    0 12px 26px rgba(145, 64, 43, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.94);
}

.child-mini-person-card {
  grid-template-columns: 18px minmax(0, 1fr);
  column-gap: 10px;
  row-gap: 2px;
  min-height: 0;
  padding: 5px 9px;
  box-shadow: 0 8px 18px rgba(60, 45, 28, 0.08);
}

.child-mini-person-card .mini-avatar {
  position: relative;
  top: auto;
  right: auto;
  grid-column: 1;
  grid-row: 1;
  width: 18px;
  height: 18px;
  transform: none;
  opacity: 0.8;
}

.child-mini-person-card strong {
  grid-column: 2;
  align-self: center;
  display: block;
  min-width: 0;
  font-size: 13px;
  line-height: 1.12;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.child-mini-person-card > span {
  grid-column: 2;
  font-size: 10px;
  line-height: 1.16;
}

.focus-relation-menu {
  display: grid;
  gap: 9px;
  align-self: start;
  border: 1px solid rgba(222, 212, 198, 0.86);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  padding: 10px 12px;
  box-shadow: 0 12px 28px rgba(60, 45, 28, 0.12);
}

.focus-relation-section {
  display: grid;
  gap: 7px;
}

.focus-relation-heading {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  justify-self: start;
  min-height: 0;
  border: 0;
  background: transparent;
  color: #087495;
  padding: 0;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.2;
}

.focus-relation-arrow {
  font-size: 0.9em;
}

.focus-relation-heading:hover {
  background: transparent;
  color: #075f79;
}

.focus-relation-list {
  display: grid;
  gap: 7px;
}

.focus-relation-person {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0 0 0 12px;
  font-size: 16px;
  font-weight: 900;
  text-align: left;
}

.focus-relation-person.relation-person-spouse {
  padding-left: 0;
  font-size: 17px;
}

.focus-relation-person.relation-person-child {
  margin-left: 24px;
  font-size: 15px;
}

.focus-relation-person:hover {
  background: transparent;
  color: var(--accent-dark);
}

.relation-mini-avatar {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border: 1px solid #d2d2d2;
  border-radius: 4px;
  background:
    radial-gradient(circle at 50% 34%, #f8f8f8 0 17%, transparent 18%),
    radial-gradient(circle at 50% 72%, #efefef 0 32%, transparent 33%),
    #fff;
}

.generation {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 12px;
  min-width: 420px;
}

.generation-title {
  flex: 0 0 100%;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.vertical-section {
  min-width: max-content;
}

.ancestor-tree,
.ancestor-node {
  display: grid;
  justify-items: center;
}

.ancestor-tree {
  gap: 24px;
  padding: 18px 18px 34px;
}

.ancestor-parents {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 44px;
}

.add-parent-card {
  display: grid;
  align-content: center;
  justify-items: center;
  width: 230px;
  min-height: 116px;
  padding: 14px;
  border: 1px solid rgba(121, 174, 230, 0.78);
  border-radius: 10px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 14px 34px rgba(93, 68, 46, 0.1);
}

.add-parent-card small {
  margin-top: 7px;
  color: rgba(38, 33, 28, 0.62);
  font-size: 12px;
  font-weight: 700;
}

.add-parent-card:hover {
  color: var(--ink);
}

.add-parent-card.disabled,
.add-parent-card.disabled:hover {
  cursor: default;
}

.add-parent-card.father {
  background:
    radial-gradient(circle at 24px 24px, rgba(255, 255, 255, 0.7) 0 14px, transparent 15px),
    var(--gender-male-bg);
}

.add-parent-card.father:hover {
  background: #e5f3ff;
}

.add-parent-card.mother {
  border-color: rgba(235, 167, 190, 0.78);
  background:
    radial-gradient(circle at 24px 24px, rgba(255, 255, 255, 0.7) 0 14px, transparent 15px),
    var(--gender-female-bg);
}

.add-parent-card.mother:hover {
  background: #ffeaf1;
}

.compact-parent-card {
  align-content: center;
  justify-items: center;
  padding: 8px 10px;
  font-size: 16px;
  line-height: 1.15;
  box-shadow: 0 10px 24px rgba(60, 45, 28, 0.1);
  min-height: inherit;
}

.grandparent-card {
  font-size: 15px;
}

.add-relation-card {
  display: grid;
  place-items: center;
  width: 104px;
  min-height: 34px;
  padding: 3px 7px;
  border: 2px dashed rgba(185, 169, 154, 0.88);
  border-radius: 999px;
  background: rgba(255, 250, 242, 0.9);
  color: #8d7564;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  box-shadow: 0 8px 20px rgba(60, 45, 28, 0.07);
}

.add-relation-card:hover {
  border-style: solid;
  background: #fff6e8;
  color: #735a48;
}

.ancestor-connector {
  width: 2px;
  height: 34px;
  background: rgba(182, 66, 45, 0.38);
}

.ancestor-person {
  position: relative;
}

.spouse-unit {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.spouse-unit.has-spouses {
  position: relative;
  padding-right: 2px;
}

.main-person {
  position: relative;
}

.spouse-branch {
  display: grid;
  gap: 8px;
  padding-left: 16px;
  border-left: 2px solid rgba(182, 66, 45, 0.28);
}

.spouse-branch::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 2px;
  margin-left: -16px;
  margin-top: 30px;
  background: rgba(182, 66, 45, 0.42);
}

.person-card {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: center;
  align-content: center;
  column-gap: 8px;
  row-gap: 4px;
  width: 210px;
  border: 1px solid rgba(149, 184, 222, 0.72);
  border-left: 0;
  border-radius: 10px;
  background: var(--surface-strong);
  padding: 14px 16px;
  cursor: pointer;
  overflow: visible;
  box-shadow: 0 14px 34px rgba(93, 68, 46, 0.1);
}

.person-card:focus-visible {
  outline: 3px solid rgba(182, 66, 45, 0.28);
  outline-offset: 3px;
}

.person-card.gender-male {
  --avatar-bg: #dcebff;
  --avatar-fg: #4d8fd7;
  --avatar-shadow: rgba(76, 116, 159, 0.16);
  border-color: rgba(121, 174, 230, 0.78);
  background: var(--gender-male-bg);
  box-shadow: 0 14px 34px var(--card-glow-male);
}

.person-card.gender-female {
  --avatar-bg: #ffe0eb;
  --avatar-fg: #df628f;
  --avatar-shadow: rgba(203, 86, 126, 0.15);
  border-color: rgba(235, 167, 190, 0.78);
  background: var(--gender-female-bg);
  box-shadow: 0 14px 34px var(--card-glow-female);
}

.person-card.gender-unknown {
  --avatar-bg: linear-gradient(180deg, #dcebff 0 50%, #ffe0eb 50% 100%);
  --avatar-fg: #8374dc;
  --avatar-shadow: rgba(114, 99, 196, 0.14);
  border-color: rgba(198, 188, 224, 0.78);
  background: var(--gender-unknown-bg);
}

.person-card.gender-male::before,
.person-card.gender-female::before,
.person-card.gender-unknown::before {
  content: "";
  position: absolute;
  top: 1px;
  bottom: 1px;
  left: 0;
  width: 4px;
  border-radius: 9px 0 0 9px;
  background: var(--gender-unknown-stripe);
  pointer-events: none;
}

.person-card.gender-male::before {
  background: var(--gender-male-color);
}

.person-card.gender-female::before {
  background: var(--gender-female-color);
}

.primary-person-node .person-card::before {
  content: none;
}

.primary-person-node .person-card {
  border-left: 1px solid currentColor;
  background-image: none;
  box-shadow: 0 10px 24px rgba(67, 51, 36, 0.08);
}

.primary-person-node .person-card.gender-male {
  color: rgba(35, 116, 166, 0.46);
  border-color: rgba(35, 116, 166, 0.42);
  background: #f5faff;
  box-shadow: 0 10px 24px rgba(35, 116, 166, 0.1);
}

.primary-person-node .person-card.gender-female {
  color: rgba(217, 91, 137, 0.46);
  border-color: rgba(217, 91, 137, 0.42);
  background: #fff6fa;
  box-shadow: 0 10px 24px rgba(217, 91, 137, 0.1);
}

.primary-person-node .person-card.gender-unknown {
  color: rgba(138, 129, 120, 0.44);
  border-color: rgba(138, 129, 120, 0.34);
  background: #fbfaf7;
  box-shadow: 0 10px 24px rgba(93, 68, 46, 0.08);
}

.focus-person-node .person-card.gender-male {
  border-color: rgba(35, 116, 166, 0.48);
  background: #f3f9ff;
  box-shadow: 0 14px 30px rgba(35, 116, 166, 0.13);
}

.focus-person-node .person-card.gender-female {
  border-color: rgba(217, 91, 137, 0.48);
  background: #fff4f8;
  box-shadow: 0 14px 30px rgba(217, 91, 137, 0.13);
}

.focus-person-node .person-card.gender-unknown {
  border-color: rgba(138, 129, 120, 0.36);
  background: #fbfaf7;
  box-shadow: 0 14px 30px rgba(93, 68, 46, 0.1);
}

.primary-person-node .person-card h4,
.primary-person-node .person-card-details,
.primary-person-node .claim-badge-button {
  color: var(--ink);
}

.person-card::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 9px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.56), transparent 48%);
  pointer-events: none;
}

.person-avatar {
  position: relative;
  z-index: 1;
  display: grid;
  grid-column: 1;
  grid-row: 1 / span 2;
  align-self: center;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  color: var(--avatar-fg, #4d8fd7);
  background: var(--avatar-bg, #dcebff);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.62), 0 7px 16px var(--avatar-shadow, rgba(76, 116, 159, 0.16));
}

.person-avatar::before {
  content: "";
  position: absolute;
  inset: 18%;
  z-index: 1;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath fill='%23000' d='M16 4.2a6.35 6.35 0 1 1 0 12.7 6.35 6.35 0 0 1 0-12.7Zm0 15.1c6.2 0 11.1 3.85 11.1 8.35 0 .86-.7 1.55-1.56 1.55H6.46c-.86 0-1.56-.69-1.56-1.55 0-4.5 4.9-8.35 11.1-8.35Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath fill='%23000' d='M16 4.2a6.35 6.35 0 1 1 0 12.7 6.35 6.35 0 0 1 0-12.7Zm0 15.1c6.2 0 11.1 3.85 11.1 8.35 0 .86-.7 1.55-1.56 1.55H6.46c-.86 0-1.56-.69-1.56-1.55 0-4.5 4.9-8.35 11.1-8.35Z'/%3E%3C/svg%3E") center / contain no-repeat;
  pointer-events: none;
}

.person-avatar::after {
  content: none;
}

.gender-female .person-avatar {
  background: var(--avatar-bg, #ffe0eb);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.62), 0 7px 16px var(--avatar-shadow, rgba(203, 86, 126, 0.15));
}

.gender-unknown .person-avatar {
  background: var(--avatar-bg, linear-gradient(180deg, #dcebff 0 50%, #ffe0eb 50% 100%));
}

.mini-person-card .mini-avatar {
  width: 18px;
  height: 18px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.62), 0 5px 10px var(--avatar-shadow, rgba(76, 116, 159, 0.14));
}

.child-mini-person-card .mini-avatar {
  width: 18px;
  height: 18px;
}

.person-card.gender-male h4 {
  color: #174e73;
}

.person-card.gender-female h4 {
  color: #9b315a;
}

.person-card.gender-unknown h4 {
  color: var(--ink);
}

.person-card.claimed {
  box-shadow: inset 0 0 0 1px rgba(38, 33, 28, 0.08);
}

.claim-badge-button {
  position: absolute;
  z-index: 2;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  min-height: 0;
  border: 1px solid rgba(38, 33, 28, 0.16);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--muted);
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.2;
  box-shadow: 0 4px 12px rgba(38, 33, 28, 0.08);
}

.person-card.gender-male .claim-badge-button {
  border-color: rgba(35, 116, 166, 0.32);
  background: var(--gender-male-bg);
  color: #174e73;
}

.person-card.gender-female .claim-badge-button {
  border-color: rgba(217, 91, 137, 0.32);
  background: var(--gender-female-bg);
  color: #9b315a;
}

.person-card.gender-unknown .claim-badge-button {
  border-color: rgba(138, 129, 120, 0.32);
  background: var(--gender-unknown-bg);
  color: var(--ink);
}

.claim-badge-button:hover {
  background: #fff;
  color: var(--ink);
  border-color: rgba(38, 33, 28, 0.28);
}

.person-card.mainline-card {
  box-shadow: inset 0 0 0 2px rgba(182, 66, 45, 0.16);
}

.person-card.mainline-card.claimed {
  box-shadow:
    inset 0 0 0 1px rgba(38, 33, 28, 0.08),
    inset 0 0 0 2px rgba(182, 66, 45, 0.18);
}

.person-card.spouse-card {
  width: 190px;
}

.person-card h4 {
  position: relative;
  z-index: 1;
  grid-column: 2;
  grid-row: 1;
  align-self: end;
  display: block;
  min-width: 0;
  width: 100%;
  margin: 0;
  font-size: 16px;
  line-height: 1.22;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.person-card-detail {
  position: relative;
  z-index: 1;
  display: block;
  justify-self: start;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  text-align: left;
}

.person-card-details {
  position: relative;
  z-index: 1;
  grid-column: 2;
  grid-row: 2;
  align-self: start;
  display: grid;
  justify-items: start;
  gap: 4px;
  width: auto;
  margin-top: auto;
  min-width: 0;
  text-align: left;
}

.lineage-position {
  overflow-wrap: anywhere;
  cursor: pointer;
}

.birth-year-detail {
  grid-column: 1;
  justify-self: start;
  width: auto;
  color: rgba(116, 107, 97, 0.9);
  font-size: 12px;
}

.child-mini-person-card .birth-year-detail {
  font-size: 10px;
}

.empty-birth-year {
  visibility: hidden;
}

.lineage-position:hover {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.spouse-label {
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
}

.person-meta,
.relation-line {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.people-list {
  display: grid;
  gap: 10px;
  max-height: 286px;
  overflow: auto;
  padding-right: 4px;
}

.person-row {
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.person-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.person-row strong {
  display: block;
  margin-bottom: 4px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(360px, calc(100vw - 36px));
  border-radius: 8px;
  background: #221c18;
  color: #fff;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(38, 33, 28, 0.38);
  padding: 20px;
}

.modal-panel {
  width: min(520px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px;
  box-shadow: 0 28px 80px rgba(38, 33, 28, 0.28);
}

.settings-feature-block {
  display: grid;
  gap: 10px;
  width: calc(100% - 12px);
  margin-left: 12px;
  padding-left: 12px;
}

.settings-feature-heading {
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.settings-feature-block label {
  color: var(--ink);
}

.settings-feature-block select {
  font-size: 13px;
  font-weight: 700;
}

.about-panel {
  width: min(620px, 100%);
}

.about-body {
  display: grid;
  gap: 16px;
}

.about-lead {
  display: grid;
  gap: 10px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.8;
}

.about-lead p {
  margin: 0;
}

.about-info-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.about-info-grid section {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(222, 212, 198, 0.86);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.78);
  padding: 14px 18px;
}

.about-info-grid h4,
.about-info-grid p {
  margin: 0;
}

.about-info-grid h4 {
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 900;
}

.about-info-grid p,
.about-info-grid address {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.65;
}

.about-info-grid address {
  display: grid;
  gap: 6px;
  padding-left: 0;
}

.about-contact-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 18px;
}

.about-contact-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  color: #635b52;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.5;
}

.about-contact-chip strong {
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}

.about-contact-address {
  padding-left: 0;
}

.about-contact-row {
  display: grid;
  grid-template-columns: minmax(3em, max-content) minmax(0, 1fr);
  align-items: center;
  column-gap: 10px;
  row-gap: 4px;
  min-height: 1.5em;
}

.about-contact-row strong {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.about-contact-placeholder {
  min-height: 1.5em;
  min-width: 0;
  color: #635b52;
  overflow-wrap: anywhere;
}

.about-contact-empty {
  min-height: 36px;
}

.modal-actions.single-action {
  justify-content: center;
  grid-template-columns: minmax(120px, 180px);
}

.modal-actions.single-action button {
  justify-self: center;
}

.confirm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 34;
  --confirm-x: 50vw;
  --confirm-y: 50vh;
  background: rgba(38, 33, 28, 0.42);
}

.confirm-panel {
  position: fixed;
  left: var(--confirm-x);
  top: var(--confirm-y);
  display: grid;
  gap: 18px;
  width: min(540px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 24px;
  box-shadow: 0 28px 80px rgba(38, 33, 28, 0.3);
  transform: translate(-50%, -50%);
}

.confirm-panel h3,
.confirm-panel p {
  margin: 0;
}

.confirm-panel p {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.75;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.confirm-panel .modal-actions {
  margin-top: 2px;
}

.modal-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.modal-heading h3 {
  margin: 0 0 6px;
}

.modal-heading > div:first-child {
  min-width: 0;
}

.modal-heading-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.icon-button {
  display: grid;
  width: 34px;
  min-height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
}

.icon-button:hover {
  background: rgba(182, 66, 45, 0.1);
  color: var(--accent-dark);
}

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

.choice-row {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 10px;
  color: var(--ink);
}

.choice-row input {
  width: auto;
}

.modal-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.modal-actions button {
  width: 100%;
  min-height: 42px;
  justify-content: center;
  padding: 0 20px;
  font-size: 14px;
}

.family-settings-actions {
  gap: 10px;
}

.settings-delete-button {
  min-height: 34px;
  border: 1px solid rgba(188, 63, 63, 0.38);
  border-radius: 6px;
  background: rgba(188, 63, 63, 0.08);
  color: #9b2c2c;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-delete-button:hover {
  border-color: rgba(188, 63, 63, 0.56);
  background: rgba(188, 63, 63, 0.16);
  color: #7f1d1d;
}

@media (max-width: 640px) {
  .about-info-grid {
    grid-template-columns: 1fr;
  }
}

.user-info-body {
  display: grid;
  gap: 18px;
}

.user-info-summary {
  display: grid;
  gap: 10px;
}

.user-info-summary div {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 11px 12px;
}

.user-info-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.user-info-summary strong {
  color: var(--ink);
  font-size: 15px;
  overflow-wrap: anywhere;
}

.danger-button {
  border: 1px solid rgba(188, 63, 63, 0.42);
  border-radius: 8px;
  background: rgba(188, 63, 63, 0.1);
  color: #9b2c2c;
}

.danger-button:hover {
  background: rgba(188, 63, 63, 0.18);
  color: #7f1d1d;
}

.person-action-overlay {
  position: fixed;
  inset: 0;
  z-index: 18;
  --person-action-x: 50vw;
  --person-action-y: 50vh;
  background: rgba(18, 18, 18, 0.82);
  padding: 74px 5vw 48px;
}

.action-close {
  position: fixed;
  top: 28px;
  right: 46px;
  min-height: 42px;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  font-size: 28px;
  font-weight: 500;
}

.action-close:hover {
  background: transparent;
  color: #fff;
}

.person-action-stage {
  position: fixed;
  left: var(--person-action-x);
  top: var(--person-action-y);
  width: 0;
  height: 0;
}

.relation-action-card {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 18px;
  border: 3px solid #21b8d0;
  border-radius: 12px;
  background: #fff;
  color: #111;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.24);
}

.action-person-card {
  position: absolute;
  display: grid;
  gap: 14px;
  border: 3px solid #ff7d83;
  border-radius: 12px;
  background: #fff;
  color: #111;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.24);
}

.relation-action-card {
  min-height: 88px;
  padding: 16px 22px;
  text-align: left;
}

.relation-action-card:hover {
  background: #fff;
  color: #111;
  transform: translateY(-1px);
}

.relation-action-card strong {
  display: block;
  font-size: 24px;
}

.relation-action-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 600;
}

.relation-avatar {
  flex: 0 0 auto;
  width: 62px;
  height: 62px;
  border: 2px solid #d2d2d2;
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 34%, #f8f8f8 0 17%, transparent 18%),
    radial-gradient(circle at 50% 72%, #efefef 0 32%, transparent 33%),
    #fff;
}

.female-avatar {
  border-color: #d5d5d5;
  background:
    radial-gradient(circle at 50% 34%, #f8f8f8 0 17%, transparent 18%),
    radial-gradient(circle at 50% 72%, #f1f1f1 0 34%, transparent 35%),
    linear-gradient(90deg, transparent 0 30%, #d0d0d0 31% 69%, transparent 70%),
    #fff;
}

.child-avatar {
  width: 58px;
  height: 58px;
}

.action-mother,
.action-sister,
.action-daughter {
  border-color: #ff7d83;
}

.action-father {
  left: 25%;
  top: 6%;
  width: 340px;
}

.action-mother {
  right: 16%;
  top: 6%;
  width: 340px;
}

.action-brother {
  left: 0;
  top: 40%;
  width: 330px;
}

.action-sister {
  left: 0;
  top: 62%;
  width: 330px;
}

.action-person-card {
  left: 0;
  top: 0;
  position: absolute;
  width: min(520px, calc(100vw - 32px));
  min-height: 310px;
  padding: 28px 36px 28px;
  transform: translate(-50%, -50%);
}

.action-person-card h3 {
  margin: 0 0 4px;
  min-height: 34px;
  padding-right: 150px;
  font-size: 30px;
  line-height: 34px;
}

.action-person-card p {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
}

.person-name-edit {
  display: grid;
  gap: 16px;
  padding-top: 6px;
}

.person-name-edit input {
  min-height: 46px;
  font-size: 16px;
}

.person-name-edit .field-hint {
  margin-top: -8px;
  font-size: 12px;
}

.person-edit-gender-field .gender-radio-group {
  gap: 10px;
}

.person-edit-gender-field .radio-pill {
  min-height: 42px;
  padding: 0 16px;
  font-size: 14px;
}

.person-edit-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 4px;
}

.person-edit-actions button {
  min-width: 132px;
  min-height: 42px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  padding: 0 18px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.person-edit-actions button:hover {
  background: var(--accent-dark);
}

.person-card-actions {
  position: absolute;
  top: 28px;
  right: 28px;
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0;
  border-top: 0;
}

.person-tool-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 0;
  height: auto;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--accent);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.person-tool-button:hover {
  border-color: var(--line);
  background: rgba(182, 66, 45, 0.1);
  color: var(--accent-dark);
}

.claim-tool-button {
  border-color: var(--line);
  background: transparent;
  color: var(--accent);
}

.claim-tool-button:hover {
  background: rgba(182, 66, 45, 0.1);
  color: var(--accent-dark);
}

.danger-tool-button {
  border-color: rgba(188, 63, 63, 0.22);
  background: rgba(188, 63, 63, 0.08);
  color: #9b2c2c;
}

.danger-tool-button:hover {
  background: rgba(188, 63, 63, 0.16);
  color: #9b2c2c;
}

.mini-tool-dot {
  display: none;
}

.action-spouse {
  right: 0;
  top: 44%;
  width: 360px;
}

.action-son {
  left: 25%;
  bottom: 0;
  width: 340px;
}

.action-daughter {
  right: 16%;
  bottom: 0;
  width: 340px;
}

.hidden {
  display: none !important;
}

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

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .family-select {
    display: block;
    width: 100%;
    min-height: 42px;
    margin-top: 0;
    font-weight: 800;
  }

  .family-list-items {
    display: none;
  }

  .top-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .family-directory-page {
    grid-template-columns: 1fr;
  }

  .help-layout {
    grid-template-columns: 1fr;
  }

  .help-toc {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (orientation: portrait) {
  .clan-list-heading {
    display: none;
  }
}

@media (max-width: 640px), (orientation: portrait) {
  .workspace,
  .sidebar {
    padding: 16px;
  }

  .help-shell {
    padding: 14px;
  }

  .help-title-row {
    align-items: center;
    gap: 12px;
  }

  .help-hero h1 {
    font-size: 28px;
    line-height: 1.15;
  }

  .help-brand-mark {
    width: 46px;
    height: 46px;
    border-radius: 11px;
    font-size: 24px;
  }

  .help-intro {
    margin-left: 58px;
    max-width: none;
    white-space: normal;
    overflow-wrap: break-word;
    font-size: 15px;
    line-height: 1.6;
  }

  .help-layout {
    gap: 14px;
    padding-top: 14px;
  }

  .help-toc {
    display: none;
  }

  .help-card {
    padding: 16px;
  }

  .help-card h2 {
    font-size: 21px;
  }

  .help-rule-grid {
    grid-template-columns: 1fr;
  }

  .help-flow {
    grid-template-columns: 1fr;
  }

  .help-flow-arrow {
    transform: rotate(90deg);
  }

  .help-lineage {
    display: flex;
    justify-content: center;
    font-size: 17px;
  }

  .workspace {
    padding: 12px;
  }

  .sidebar {
    position: relative;
    --portrait-user-gap: 8px;
    --portrait-user-width: 112px;
  }

  .sidebar .brand {
    min-height: 42px;
    margin-right: 104px;
    margin-bottom: 14px;
  }

  .sidebar:has(.current-user:not(.hidden)) .brand {
    margin-right: calc(104px + var(--portrait-user-gap) + var(--portrait-user-width));
  }

  .brand-mark {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }

  .brand h1 {
    font-size: 22px;
    line-height: 1.1;
  }

  .brand p {
    display: none;
  }

  .language-switcher {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 8;
    width: 88px;
    margin: 0;
  }

  .sidebar:has(.current-user:not(.hidden)) .language-switcher {
    right: calc(16px + var(--portrait-user-width) + var(--portrait-user-gap));
  }

  .language-switcher select {
    height: 34px;
    min-height: 34px;
    padding: 6px 7px;
    font-size: 12px;
  }

  .graph-panel {
    min-height: 0;
  }

  .family-workspace {
    gap: 10px;
  }

  .content-grid {
    gap: 10px;
  }

  .content-grid .panel {
    padding: 8px;
  }

  .directory-tree-panel h3 {
    font-size: 15px;
  }

  .directory-generation-list {
    max-height: none;
  }

  .tree-view {
    min-height: 0;
    overflow-x: auto;
    overflow-y: visible;
    --canvas-frame-gap: 6px;
    padding: var(--canvas-frame-gap);
  }

  .start-person-panel {
    min-height: clamp(360px, calc(100vh - 300px), 620px);
    padding: 20px;
  }

  .pedigree-editor {
    align-content: start;
    justify-items: start;
    min-height: 0;
  }

  .tree-canvas {
    border-radius: 6px;
  }

  .mobile-canvas .person-node .person-card {
    width: 100%;
    min-height: 88px;
    padding: 10px 12px;
  }

  .mobile-canvas .focus-person-node .person-card {
    min-height: 104px;
    padding: 12px;
  }

  .mobile-canvas .person-node:has(.focus-relation-menu) {
    width: 150px;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .mobile-canvas .focus-relation-menu {
    width: 150px;
    padding: 8px;
    gap: 7px;
  }

  .mobile-canvas .focus-relation-heading {
    font-size: 14px;
  }

  .mobile-canvas .focus-relation-person {
    gap: 6px;
    padding-left: 4px;
    font-size: 12px;
  }

  .mobile-canvas .focus-relation-person.relation-person-spouse {
    padding-left: 0;
    font-size: 13px;
  }

  .mobile-canvas .focus-relation-person.relation-person-child {
    margin-left: 14px;
    font-size: 12px;
  }

  .mobile-canvas .relation-mini-avatar {
    width: 22px;
    height: 22px;
  }

  .mobile-canvas .person-card h4 {
    margin-bottom: 8px;
    font-size: 16px;
    line-height: 1.2;
  }

  .mobile-canvas .focus-person-node .person-card h4 {
    font-size: 17px;
  }

  .mobile-canvas .person-card-detail,
  .mobile-canvas .mini-person-card span,
  .mobile-canvas .child-mini-person-card span {
    font-size: 12px;
    line-height: 1.25;
  }

  .mobile-canvas .person-meta,
  .mobile-canvas .relation-line {
    font-size: 11px;
    line-height: 1.3;
  }

  .mobile-canvas .add-relation-card {
    padding: 3px 6px;
    font-size: 10px;
    line-height: 1.15;
  }

  .mobile-canvas .add-parent-card {
    padding: 10px 12px;
    font-size: 16px;
    line-height: 1.15;
  }

  .mobile-canvas .grandparent-card {
    font-size: 14px;
  }

  .mobile-canvas .add-relation-card {
    min-height: 34px;
    border-width: 1.5px;
    white-space: nowrap;
  }

  .mobile-canvas .parent-line {
    stroke: rgba(82, 76, 68, 0.86);
    stroke-width: 1;
  }

  .auth-panel:has(#authForm.hidden) {
    border: 0;
    background: transparent;
    box-shadow: none;
    padding: 0;
    margin-top: 0;
  }

  .auth-panel .current-user:not(.hidden) {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 9;
    display: flex;
    align-items: center;
    gap: 6px;
    width: auto;
    max-width: 112px;
    height: 34px;
    min-height: 34px;
    padding: 6px 8px;
    font-size: 12px;
  }

  .auth-panel .current-user:not(.hidden)::before {
    width: 14px;
    height: 14px;
  }

  .auth-panel .current-user.gender-male,
  .auth-panel .current-user.gender-female,
  .auth-panel .current-user.gender-unknown {
    border-left-width: 4px;
  }

  .auth-panel:has(#authForm.hidden) .claim-block:not(.hidden) {
    margin-top: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    padding: 13px;
  }

  .family-item {
    display: grid;
    align-items: center;
  }

  .workspace-header,
  .two-columns {
    display: grid;
    grid-template-columns: 1fr;
  }

  .workspace-header {
    justify-items: stretch;
    text-align: left;
  }

  .workspace-title-row {
    grid-template-columns: 36px minmax(0, 1fr) auto;
  }

  .workspace-header.no-family-badge .workspace-title-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .family-surname-badge {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }

  .family-surname-badge.two-character-badge {
    font-size: 15px;
  }

  .stats::before {
    flex-basis: 36px;
    width: 36px;
    min-height: 36px;
  }

  .workspace-family-actions {
    justify-content: flex-end;
  }

  .workspace-header h2 {
    font-size: 21px;
    line-height: 1.3;
  }

  .stats {
    justify-content: flex-start;
  }

  .stats-inline {
    font-size: 11px;
    line-height: 1.15;
  }

  .generation {
    min-width: 0;
  }

  .person-card {
    width: 100%;
  }

  .spouse-unit {
    display: grid;
    width: 100%;
  }

  .spouse-branch {
    padding-left: 12px;
  }

  .person-card.spouse-card {
    width: 100%;
  }

  .person-action-overlay {
    padding: 54px 12px 16px;
  }

  .action-close {
    top: 8px;
    right: 12px;
    min-height: 34px;
    font-size: 22px;
  }

  .person-action-stage {
    position: fixed;
    left: var(--person-action-x);
    top: var(--person-action-y);
    width: 0;
    height: 0;
  }

  .action-person-card {
    position: absolute;
    left: 0;
    top: 0;
    width: min(340px, calc(100vw - 24px));
    min-width: 0;
    min-height: 280px;
    transform: translate(-50%, -50%);
  }

  .action-person-card {
    gap: 12px;
    padding: 18px;
  }

  .action-person-card h3 {
    margin-bottom: 2px;
    min-height: 32px;
    padding-right: 130px;
    font-size: 24px;
    line-height: 32px;
  }

  .action-person-card p {
    font-size: 14px;
  }

  .person-card-actions {
    top: 18px;
    right: 18px;
    gap: 6px;
    min-height: 32px;
  }

  .person-name-edit {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .person-edit-actions {
    justify-content: stretch;
  }

  .person-tool-button {
    min-height: 34px;
    padding: 0 12px;
    font-size: 12px;
  }

  .person-edit-actions button {
    width: 100%;
    min-height: 34px;
    padding: 0 12px;
    font-size: 12px;
  }

  .person-tool-button {
    width: auto;
    min-width: 0;
    height: auto;
    min-height: 30px;
    padding: 0 9px;
    font-size: 12px;
  }

  .relation-action-card {
    gap: 11px;
    padding: 10px 12px;
    border-width: 2px;
    border-radius: 8px;
  }

  .relation-action-card strong {
    font-size: 17px;
  }

  .relation-action-card small {
    margin-top: 2px;
    font-size: 12px;
    line-height: 1.35;
  }

  .relation-avatar,
  .child-avatar {
    width: 42px;
    height: 42px;
  }

  .action-father {
    order: 1;
  }

  .action-mother {
    order: 2;
  }

  .action-spouse {
    order: 3;
  }

  .action-brother {
    order: 5;
  }

  .action-sister {
    order: 6;
  }

  .action-son {
    order: 7;
  }

  .action-daughter {
    order: 8;
  }
}
