:root {
  --ink: #293c35;
  --muted: #7d8981;
  --green: #3e6654;
  --paper: #f7f8f4;
  --line: #e2e7df;
  --sage: #eaf0e6;
  --gold: #a38a55;
  --rose: #a76b70;
  --blue: #648aa4;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--paper);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  outline-offset: 4px;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  border-radius: 7px;
  padding: 10px 15px;
  transition: background 0.15s;
}
button:hover {
  background: var(--sage);
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
.primary {
  background: var(--green);
  color: white;
  border-color: var(--green);
}
.primary:hover {
  background: #2b5240;
}
a {
  color: inherit;
  text-decoration: none;
}
input,
textarea,
select {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: #fff;
  color: var(--ink);
  max-width: 100%;
}
textarea {
  resize: vertical;
  min-height: 95px;
}
label {
  display: grid;
  gap: 7px;
  font-size: 12px;
  color: var(--muted);
}
[hidden] {
  display: none !important;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 246px;
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 25px 19px;
  z-index: 20;
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 9px 26px;
  font-family: Georgia, serif;
  font-size: 32px;
  letter-spacing: -1px;
}
.brand-mark {
  font-family: Georgia, serif;
  color: var(--green);
  font-size: 50px;
  line-height: 1;
}
.brand small {
  font:
    9px "Segoe UI",
    sans-serif;
  display: block;
  letter-spacing: 2px;
  margin-top: 4px;
  color: var(--muted);
}
.family-owner {
  display: flex;
  gap: 11px;
  align-items: center;
  border-block: 1px solid var(--line);
  padding: 19px 6px;
}
.family-owner b {
  display: block;
  font-size: 12px;
}
.family-owner small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 6px;
}
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #edf1e5;
  color: #75805b;
  font:
    16px Georgia,
    serif;
  flex-shrink: 0;
}
.avatar img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}
.nav-label {
  font-size: 10px;
  letter-spacing: 1.8px;
  color: #9aa199;
  margin: 25px 11px 12px;
}
nav {
  display: grid;
  gap: 3px;
}
nav a {
  padding: 11px 10px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: #738078;
}
nav a > span {
  font-size: 20px;
  width: 22px;
  text-align: center;
}
nav a.active {
  background: #eaf0e7;
  color: #315c44;
  font-weight: 600;
}
nav a:hover {
  background: var(--paper);
}
nav a small {
  margin-left: auto;
  font-size: 10px;
  background: #dfe9d9;
  border-radius: 4px;
  padding: 3px 5px;
}
.sidebar-footer {
  margin-top: auto;
  padding: 25px 9px 0;
  font-size: 10px;
  color: #7d887c;
}
.sidebar-footer small {
  display: block;
  font-size: 9px;
  margin-top: 8px;
  color: #a2aaa0;
}
.live-dot {
  display: inline-block;
  border-radius: 50%;
  width: 6px;
  height: 6px;
  background: #70966f;
  margin-right: 5px;
}
main {
  margin-left: 246px;
  min-height: 100vh;
}
.topbar {
  height: 77px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 23px;
  align-items: center;
  padding: 0 35px;
}
.breadcrumb {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.breadcrumb span {
  margin: 0 12px;
  color: #c4ccc3;
}
.breadcrumb b {
  font-weight: 400;
  color: var(--ink);
}
.search {
  margin-left: auto;
  display: flex;
  gap: 7px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  width: 250px;
  height: 36px;
  padding: 0 11px;
  background: #fafbf8;
}
.search input {
  border: 0;
  outline: none;
  background: none;
  padding: 0;
  min-width: 0;
  flex: 1;
  font-size: 11px;
}
.search span {
  font-size: 23px;
}
.search kbd {
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: 10px;
  padding: 1px 4px;
}
.topbar .primary {
  font-size: 11px;
  padding: 10px 14px;
}
.page {
  padding: 33px 35px;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  align-items: center;
  margin-bottom: 25px;
}
.eyebrow {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #8c977e;
  margin-bottom: 10px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font:
    32px Georgia,
    serif;
  letter-spacing: -0.7px;
  margin-bottom: 10px;
}
h2 {
  font:
    23px Georgia,
    serif;
}
h3 {
  font-size: 14px;
}
p.subtitle {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 0;
  line-height: 1.7;
}
.outline-button {
  font-size: 11px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 26px;
}
.stat {
  background: white;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 17px 20px;
  display: flex;
  align-items: center;
  gap: 15px;
}
.stat-icon {
  font-size: 24px;
  color: #819277;
  background: #f3f5ef;
  border-radius: 8px;
  padding: 8px 12px;
}
.stat b {
  display: block;
  font:
    26px Georgia,
    serif;
}
.stat small {
  font-size: 10px;
  color: var(--muted);
  display: block;
  margin-top: 5px;
}
.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.toolbar {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.toolbar select {
  font-size: 11px;
  padding: 8px;
  background: #fff;
}
.toolbar .spacer {
  flex: 1;
}
.segmented {
  display: flex;
  background: #f2f4ef;
  border: 1px solid var(--line);
  padding: 3px;
  border-radius: 6px;
  gap: 3px;
}
.segmented button {
  border: 0;
  background: none;
  padding: 6px 12px;
  font-size: 11px;
}
.segmented button.active {
  background: white;
  box-shadow: 0 1px 3px #0001;
  color: var(--green);
}
.legend {
  font-size: 10px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 7px;
}
.legend i {
  width: 6px;
  height: 6px;
  background: #91adbe;
  border-radius: 50%;
  display: inline-block;
}
.legend i.f {
  background: #c69b9c;
}
.graph-area {
  position: relative;
  height: 530px;
  background-color: #fbfcf8;
  background-image: radial-gradient(#d8dfd0 0.8px, transparent 0.8px);
  background-size: 19px 19px;
  overflow: hidden;
}
.graph-area svg {
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}
.graph-area svg.dragging {
  cursor: grabbing;
}
.tree-card {
  cursor: pointer;
}
.tree-card rect.card {
  fill: white;
  stroke: #d9e0d5;
  stroke-width: 1;
}
.tree-card:hover rect.card {
  stroke: #78916a;
  stroke-width: 2;
}
.tree-card.selected rect.card {
  stroke: #62805b;
  stroke-width: 2;
  fill: #f5f8ef;
}
.tree-card .name {
  font-size: 12px;
  fill: #34443b;
  font-weight: 600;
}
.tree-card .dates {
  font-size: 11px;
  fill: #707a70;
}
.tree-card .initials {
  font:
    22px Georgia,
    serif;
}
.tree-edge {
  fill: none;
  stroke: #67806a;
  stroke-width: 1.8;
  stroke-linejoin: round;
}
.tree-edge.partner {
  stroke: #94769c;
}
.tree-edge-halo {
  fill: none;
  stroke: #fafbf8;
  stroke-width: 6;
  stroke-linejoin: round;
}
.tree-edge-hit {
  fill: none;
  stroke: transparent;
  stroke-width: 12;
  pointer-events: stroke;
  cursor: pointer;
}
.tree-junction {
  fill: #67806a;
  stroke: #fafbf8;
  stroke-width: 0.8;
}
.tree-connection.highlighted .tree-edge {
  stroke-width: 3;
}
.tree-connection.highlighted .tree-edge-halo {
  stroke-width: 8;
}
.tree-card.muted {
  opacity: 0.24;
}
.tree-connection.muted {
  opacity: 0.12;
}
.tree-card.related .card {
  stroke: #486d51;
  stroke-width: 2;
}
.relationship-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.relationship-legend i {
  display: inline-block;
  width: 18px;
  height: 2px;
  background: #67806a;
}
.relationship-legend .partner-line {
  background: #94769c;
}
#tree-caption {
  max-width: 65%;
  overflow-wrap: anywhere;
}
.graph-controls {
  position: absolute;
  bottom: 18px;
  right: 18px;
  display: flex;
  gap: 4px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 4px;
  box-shadow: 0 3px 10px #00000005;
}
.graph-controls button {
  padding: 6px 10px;
  border: 0;
  font-size: 16px;
}
.graph-label {
  position: absolute;
  bottom: 22px;
  left: 22px;
  color: #8a9682;
  font-size: 10px;
  pointer-events: none;
}
.panel-bottom {
  display: flex;
  justify-content: space-between;
  padding: 13px 20px;
  border-top: 1px solid var(--line);
  font-size: 10px;
  color: var(--muted);
}
.below-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 18px;
  margin-top: 22px;
}
.mini-panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 20px;
}
.mini-panel h3 {
  font:
    17px Georgia,
    serif;
  margin-bottom: 16px;
}
.mini-panel p {
  font-size: 11px;
  line-height: 1.7;
  color: var(--muted);
}
.person-row {
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #edf0e9;
  cursor: pointer;
}
.person-row:last-child {
  border-bottom: 0;
}
.person-row b {
  font-size: 12px;
}
.person-row small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 4px;
}
.person-row .row-end {
  margin-left: auto;
  font-size: 11px;
  color: var(--gold);
}
.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 13px;
}
.person-tile {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 18px;
  text-align: left;
  display: flex;
  gap: 12px;
  align-items: center;
}
.person-tile b {
  display: block;
  font-size: 12px;
  line-height: 1.5;
}
.person-tile small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
  margin-top: 4px;
}
.filters {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.filters select {
  font-size: 12px;
}
.filters .count {
  font-size: 12px;
  color: var(--muted);
  margin-left: auto;
}
.detail {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: 390px;
  background: #fff;
  z-index: 30;
  box-shadow: -8px 0 40px #27392419;
  border-left: 1px solid var(--line);
  padding: 25px;
  overflow: auto;
}
.detail-close {
  float: right;
}
.icon {
  border: 0;
  background: transparent;
  padding: 5px 10px;
  font-size: 23px;
}
.detail .hero-avatar {
  width: 76px;
  height: 76px;
  font-size: 30px;
  margin-top: 22px;
  margin-bottom: 17px;
}
.detail h2 {
  font-size: 25px;
  margin-bottom: 7px;
  line-height: 1.3;
}
.detail p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
}
.detail-actions {
  display: flex;
  gap: 7px;
  margin: 22px 0;
}
.detail-actions button {
  font-size: 11px;
  padding: 9px;
}
.detail-section {
  border-top: 1px solid var(--line);
  padding: 20px 0;
}
.detail-section h3 {
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
}
.detail-section p {
  color: var(--ink);
  white-space: pre-wrap;
}
.detail-section dl {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
  font-size: 12px;
}
.detail-section dt {
  color: var(--muted);
}
.detail-section dd {
  margin: 0;
  overflow-wrap: anywhere;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 13px;
  width: 560px;
  max-width: 94vw;
  padding: 30px;
  color: var(--ink);
  box-shadow: 0 18px 100px #24352b30;
}
dialog::backdrop {
  background: #24352b60;
  backdrop-filter: blur(3px);
}
.dialog-close {
  position: absolute;
  right: 14px;
  top: 10px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 17px;
}
.form-grid .wide {
  grid-column: 1/-1;
}
.form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 23px;
}
.form-error {
  color: #a84343;
  font-size: 12px;
  margin-top: 15px;
}
.toast {
  position: fixed;
  bottom: 23px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 20px;
  background: #2e4939;
  color: white;
  border-radius: 8px;
  z-index: 100;
  box-shadow: 0 5px 20px #0002;
}
.feed {
  max-width: 860px;
  margin: auto;
}
.feed-item {
  background: white;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 20px;
  margin-bottom: 12px;
}
.feed-item p {
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.9;
  margin-bottom: 0;
}
.feed-meta {
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 10px;
}
.feed-item img {
  max-width: 220px;
  max-height: 180px;
}
.empty {
  padding: 60px 25px;
  text-align: center;
  color: var(--muted);
  background: #fff;
  border: 1px dashed #d8dfd2;
  border-radius: 9px;
}
.empty b {
  display: block;
  color: var(--ink);
  font:
    22px Georgia,
    serif;
  margin-bottom: 12px;
}
.empty p {
  font-size: 12px;
  line-height: 1.8;
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
}
.month {
  background: white;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 18px;
}
.month h3 {
  font:
    19px Georgia,
    serif;
}
.month .person-row {
  padding: 8px 0;
}
.month .avatar {
  width: 29px;
  height: 29px;
  font-size: 11px;
}
.month .person-row b {
  font-size: 11px;
}
.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 18px;
}
.photo-card {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 9px;
  overflow: hidden;
}
.photo-card img {
  width: 100%;
  height: 190px;
  object-fit: cover;
}
.photo-card p {
  font-size: 12px;
  padding: 12px;
  margin: 0;
}
.archive-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 17px;
}
.export-card {
  padding: 25px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}
.export-card h3 {
  font:
    23px Georgia,
    serif;
}
.export-card p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
}
.export-card a {
  display: inline-block;
  border: 1px solid var(--line);
  padding: 10px 15px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--green);
}
.report {
  background: #edf2e8;
  border: 1px solid #dce6d5;
  border-radius: 9px;
  padding: 22px;
  margin-top: 23px;
  font-size: 12px;
  line-height: 1.8;
}
.source-text {
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.9;
}
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at top, #e6eddc, transparent 65%), var(--paper);
}
.login-card {
  width: 360px;
  max-width: 90vw;
  padding: 37px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 15px;
  text-align: center;
}
.login-card label {
  text-align: left;
  margin: 25px 0 17px;
}
.login-card h1 {
  font-size: 40px;
  margin-top: 12px;
}
.login-card p {
  color: var(--muted);
}
.login-card button {
  width: 100%;
}
.mobile {
  display: none;
}
.danger {
  color: #a86464;
}
.minor {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.8;
}
.row-links {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}
.row-links button {
  font-size: 10px;
  padding: 7px;
}
.photo-view {
  max-width: 100%;
  max-height: 65vh;
}
.table-wrap {
  overflow-x: auto;
}
table.audit {
  width: 100%;
  font-size: 12px;
  border-collapse: collapse;
}
table.audit td,
table.audit th {
  text-align: left;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}
@media (min-width: 1600px) {
  .page {
    padding: 38px 48px;
  }
  .graph-area {
    height: 610px;
  }
  .sidebar {
    width: 265px;
  }
  main {
    margin-left: 265px;
  }
  .topbar {
    padding-inline: 48px;
  }
}
@media (max-width: 1150px) {
  .sidebar {
    width: 211px;
    padding-inline: 12px;
  }
  main {
    margin-left: 211px;
  }
  .topbar {
    padding: 0 22px;
    gap: 12px;
  }
  .page {
    padding: 25px 22px;
  }
  .breadcrumb {
    display: none;
  }
  .stats {
    gap: 9px;
  }
  .stat {
    padding: 15px 12px;
  }
  .stat-icon {
    display: none;
  }
  .search {
    margin-left: 0;
    flex: 1;
  }
  .calendar-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 760px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.2s;
    width: 245px;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 0 0 0 100vw #24352b55;
  }
  main {
    margin-left: 0;
  }
  .mobile {
    display: block;
  }
  .topbar {
    height: 65px;
    padding: 0 12px;
    gap: 8px;
  }
  .topbar .primary {
    font-size: 0;
    padding: 7px 11px;
  }
  .topbar .primary::first-letter {
    font-size: 22px;
  }
  .search {
    width: auto;
  }
  .page {
    padding: 23px 15px;
  }
  h1 {
    font-size: 27px;
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .stat {
    padding: 13px 16px;
  }
  .stat b {
    font-size: 25px;
  }
  .below-grid,
  .archive-grid {
    grid-template-columns: 1fr;
  }
  .graph-area {
    height: 470px;
  }
  .legend {
    display: none;
  }
  .panel-bottom {
    font-size: 9px;
    padding: 12px;
  }
  .toolbar {
    padding: 11px;
    gap: 5px;
  }
  .toolbar select {
    max-width: 145px;
  }
  .page-heading {
    align-items: flex-start;
  }
  .detail {
    width: min(390px, 100vw);
  }
  .calendar-grid {
    grid-template-columns: 1fr;
  }
  .form-grid {
    gap: 12px;
  }
  .page-heading > .outline-button {
    padding: 8px;
    font-size: 10px;
  }
  .people-grid {
    grid-template-columns: 1fr;
  }
  .graph-label {
    max-width: 170px;
    line-height: 1.8;
  }
  .family-owner {
    padding-block: 15px;
  }
  .nav-label {
    margin-top: 15px;
  }
  nav a {
    padding-block: 8px;
  }
}
@media print {
  .sidebar,
  .topbar,
  .toolbar,
  .graph-controls,
  .detail {
    display: none;
  }
  main {
    margin: 0;
  }
  .page {
    padding: 0;
  }
  .graph-area {
    height: 800px;
  }
  .panel {
    border: 0;
  }
}

.tree-card .given-name, .tree-card .patronymic { font-size: 13px; fill: #34443b; }
.tree-card .maiden { font-size: 12px; fill: #6d7d72; }
.tree-card .initials { fill: #809e92; }
