:root {
  font-family: system-ui, sans-serif;
  color: #2b241b;
  background: #f5f0e7;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 4vw;
  background: #382d20;
  color: #fff;
}
header .brand {
  font: 700 1.6rem Georgia;
  color: #ffd98a;
  text-decoration: none;
}
header form {
  margin-left: auto;
}
main {
  max-width: 1200px;
  margin: auto;
  padding: 1.5rem;
}
nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
a {
  color: #75521c;
}
section,
article {
  background: #fff;
  border: 1px solid #dfd3c1;
  border-radius: 0.5rem;
  padding: 1rem;
  margin: 0.8rem 0;
}
.welcome > div:first-child {
  text-align: center;
  padding: 2rem;
}
.auth,
.columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}
label {
  display: block;
  margin: 0.65rem 0;
  font-weight: 600;
}
input,
select,
textarea,
button {
  font: inherit;
  width: 100%;
  padding: 0.55rem;
  border: 1px solid #aa987f;
  border-radius: 0.3rem;
}
textarea {
  min-height: 6rem;
}
textarea[name="description"] {
  min-height: 16rem;
  line-height: 1.45;
  resize: vertical;
}
button {
  width: auto;
  background: #76541d;
  color: #fff;
  border: 0;
  cursor: pointer;
}
.message {
  padding: 1rem;
  border-radius: 0.4rem;
}
.ok {
  background: #dff3dc;
}
.error-popup {
  position: fixed;
  inset: 0;
  z-index: 1000;
  margin: auto;
  max-width: min(28rem, calc(100vw - 2rem));
  padding: 1.4rem;
  border: 2px solid #9a3c2d;
  border-radius: 0.6rem;
  background: #ffe0d9;
  box-shadow: 0 1rem 4rem #0008;
}
.error-popup::backdrop,
.person-picker::backdrop {
  background: #0008;
}
.error-popup button {
  display: block;
  margin: 1rem auto 0;
  min-width: 6rem;
}
.tree {
  overflow: auto;
}
.tree-continuation {
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  height: 14px;
  overflow: hidden;
  opacity: 0.65;
  pointer-events: none;
}
.tree-continuation span {
  width: 130px;
  min-width: 130px;
  height: 42px;
  border: 2px solid #b98d3e;
  border-radius: 0.4rem;
  background: linear-gradient(transparent, #fff7dc);
}
.tree-continuation-top {
  align-items: flex-end;
}
.tree-continuation-bottom span {
  background: linear-gradient(#fff7dc, transparent);
}
.selected-profile {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}
.selected-profile-photo {
  flex: 0 0 auto;
  padding: 0;
  background: transparent;
}
.selected-profile-photo img {
  display: block;
  width: min(260px, 42vw);
  height: min(260px, 42vw);
  object-fit: contain;
  background: #eee4cb;
}
.selected-profile h2 {
  margin-bottom: 0.25rem;
}
.selected-profile p {
  margin-top: 0;
}
.generation {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 0.8rem;
  min-width: 650px;
  margin: 0.5rem;
}
.generation:empty {
  display: none;
}
.generation > span {
  width: 5rem;
  color: #776b5a;
}
.person {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 130px;
  text-align: center;
  text-decoration: none;
  background: #fff7dc;
  border: 2px solid #b98d3e;
  border-radius: 0.4rem;
  padding: 0.6rem;
}
.person.selected-person::after {
  content: "";
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: #9a3c2d;
  box-shadow: 0 0 0 2px #fff7dc;
}
.person img {
  display: block;
  width: 70px;
  height: 70px;
  overflow: hidden;
  object-fit: cover;
  object-position: center;
  margin: auto;
}
.person-content-count {
  margin-top: 0.35rem;
  padding: 0.2rem 0.3rem;
  border-radius: 0.25rem;
  background: #f1dcae;
  color: #5b3b12;
  font-weight: bold;
}
.person.deceased img {
  filter: grayscale(0.35) sepia(0.8) saturate(0.75);
}
.person.unverified {
  border-style: dashed;
}
.photo-workbench > img {
  display: block;
  max-width: 100%;
  max-height: 70vh;
  margin: auto;
  object-fit: contain;
}
.existing-person {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.65rem 0;
}
.existing-person .search-person {
  font-size: 1.35rem;
}
.existing-person .clear-person {
  background: #8a7560;
}
.relation-person-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0 0.7rem;
}
.inline-person-results {
  max-height: 19rem;
  overflow-y: auto;
  margin: 0.65rem 0;
  padding: 0.25rem;
  border: 1px solid #d8c49f;
  border-radius: 0.4rem;
}
.inline-person-choice.selected {
  outline: 3px solid #9a3c2d;
  outline-offset: -2px;
}
.new-person-choice {
  width: 100%;
  margin: 0.4rem 0;
  color: #382d20;
  background: #dedbd6;
  border-color: #aaa39a;
}
.new-person-choice.selected {
  color: #fff;
  background: #b85b4c;
  border-color: #9a3c2d;
}
.person-picker {
  width: min(48rem, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  border: 2px solid #b98d3e;
  border-radius: 0.6rem;
  padding: 1.2rem;
}
.person-picker .dialog-close {
  float: right;
  font-size: 1.5rem;
  background: transparent;
  color: #382d20;
}
.picker-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0 0.8rem;
}
.person-results {
  margin: 1rem 0;
  max-height: 40vh;
  overflow: auto;
}
.person-result {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
  margin: 0.4rem 0;
  text-align: left;
  background: #fff7dc;
  color: #2b241b;
  border: 1px solid #b98d3e;
}
.person-result img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  object-position: center;
}
.person-result span {
  display: flex;
  flex-direction: column;
}
.request {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.request form {
  display: inline;
}
.unread {
  border-left: 5px solid #c48318;
}
.heirloom-expanded {
  max-height: 70vh;
  overflow-y: auto;
  overflow-wrap: anywhere;
}
.heirloom-incomplete {
  background: #b3261e18;
  border-color: #b3261e80;
}
.heirloom-warning {
  display: block;
  color: #9a2f25;
  font-weight: 700;
  margin: 0.35rem 0;
}
.heirloom-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.heirloom-actions form {
  margin: 0;
}
.heirloom-actions .danger {
  background: #9a2f25;
}
small {
  color: #716758;
}
footer {
  text-align: center;
  padding: 2rem;
  color: #716758;
}
@media (max-width: 600px) {
  main {
    padding: 0.7rem;
  }
  .generation-level-m2,
  .generation-level-2 {
    height: 14px;
    overflow: hidden;
    opacity: 0.65;
    pointer-events: none;
  }
  .generation-level-m2 .person,
  .generation-level-2 .person {
    height: 42px;
    min-height: 42px;
    color: transparent;
    background: linear-gradient(transparent, #fff7dc);
  }
  .generation-level-m2 {
    align-items: flex-end;
  }
  .generation-level-2 .person {
    background: linear-gradient(#fff7dc, transparent);
  }
  .generation-level-m2 .person > *,
  .generation-level-2 .person > * {
    visibility: hidden;
  }
  .tree-continuation {
    display: none;
  }
}

.invite-family {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}
.invite-family article {
  min-width: 10rem;
}
.invite-confirm {
  max-width: 38rem;
  margin: 1rem auto;
}
.test-banner {
  padding: 0.8rem;
  background: #8b1717;
  color: #fff;
  text-align: center;
  font-weight: bold;
}
.test-banner form {
  display: inline;
  margin-left: 1rem;
}
.wait-image {
  position: fixed;
  inset: 0;
  z-index: 10005;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: #2b241bcc;
  color: #fff;
}
.wait-image[hidden] {
  display: none;
}
.wait-image span {
  width: 3.5rem;
  height: 3.5rem;
  border: 0.45rem solid #fff5;
  border-top-color: #ffd98a;
  border-radius: 50%;
  animation: wait-spin 0.8s linear infinite;
}
@keyframes wait-spin {
  to {
    transform: rotate(360deg);
  }
}
.profile-photo-thumb {
  display: block;
  padding: 0;
  margin: 1rem auto 0;
  background: transparent;
}
.profile-photo-thumb img {
  display: block;
  max-width: 180px;
  max-height: 180px;
  object-fit: contain;
}
.profile-photo-dialog {
  width: min(90vw, 70rem);
  max-height: 90vh;
  padding: 2.8rem 1rem 1rem;
  border: 0;
  background: #17130f;
}
.profile-photo-dialog::backdrop {
  background: #000c;
}
.profile-photo-dialog img {
  display: block;
  max-width: 100%;
  max-height: calc(90vh - 4rem);
  margin: auto;
  object-fit: contain;
  filter: none;
}
.profile-photo-dialog button {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
}
.person.online::before {
  content: "";
  position: absolute;
  top: 0.35rem;
  left: 0.35rem;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: #28a745;
  box-shadow: 0 0 0 2px #fff7dc;
}
.status-dot-hit {
  position: absolute;
  top: 0.25rem;
  width: 0.85rem;
  height: 0.85rem;
  z-index: 2;
}
.online-dot-hit {
  left: 0.25rem;
}
.selected-dot-hit {
  right: 0.25rem;
}
.online-label {
  color: #207c35;
}
.full-tree-toolbar {
  display: flex;
  justify-content: center;
  margin: 0.7rem;
}
.full-tree-toolbar a {
  display: inline-block;
  padding: 0.55rem 0.8rem;
  background: #76541d;
  color: #fff;
  border-radius: 0.3rem;
  text-decoration: none;
}
.full-tree {
  overflow: auto;
}
.full-tree-table {
  display: grid;
  gap: 0.8rem;
  min-width: max-content;
}
.full-tree-row {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 0.6rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid #dfd3c1;
}
.full-tree-row .person {
  width: 130px;
}
.full-tree-row .collateral {
  background: #e4e2de;
  border-color: #999;
  color: #625f59;
}
.heirloom-summary {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: inherit;
  text-decoration: none;
}
.heirloom-summary img {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  object-fit: cover;
}
.heirloom-summary > span {
  min-width: 0;
}
.heirloom-excerpt {
  display: -webkit-box;
  margin: 0.25rem 0 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}
.heirloom-expanded .profile-photo-thumb img {
  max-width: 220px;
  max-height: 220px;
}
.heirloom-people {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.5rem 0;
}
.heirloom-person-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.55rem;
  background: #fff7dc;
  border: 1px solid #b98d3e;
  border-radius: 1rem;
}
.heirloom-person-tag button {
  padding: 0.1rem 0.35rem;
}
.heirloom-recognitions > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0.35rem 0;
}
.heirloom-recognitions form {
  margin: 0;
}
.external-person-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr) auto;
  gap: 0.4rem;
  margin: 0.5rem 0;
}
.notification-heirloom {
  position: fixed;
  inset: 0;
  z-index: 900;
  margin: auto;
  width: min(42rem, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  overflow: auto;
  border: 2px solid #b98d3e;
  border-radius: 0.6rem;
  padding: 2.5rem 1.2rem 1.2rem;
  box-shadow: 0 0 0 100vmax #0009;
}
.notification-heirloom > .dialog-close {
  position: absolute;
  top: 0.5rem;
  right: 0.7rem;
  font-size: 1.6rem;
  text-decoration: none;
}
.notification-heirloom > img {
  display: block;
  max-width: 100%;
  max-height: 45vh;
  margin: auto;
  object-fit: contain;
}
.notice-popup {
  position: fixed;
  inset: 0;
  z-index: 1000;
  margin: auto;
  max-width: min(28rem, calc(100vw - 2rem));
  padding: 1.4rem;
  border: 2px solid #57814c;
  border-radius: 0.6rem;
  background: #dff3dc;
  box-shadow: 0 1rem 4rem #0008;
}
.notice-popup::backdrop {
  background: #0008;
}
.notice-popup button {
  display: block;
  margin: 1rem auto 0;
  min-width: 6rem;
}
.heirlooms-mine > article {
  background: #fff7dc;
}
.heirlooms-for-others > article {
  background: #edf4f7;
}
.heirlooms-mine > article.heirloom-incomplete,
.heirlooms-for-others > article.heirloom-incomplete {
  background: #b3261e18;
}
#cimeli > article.heirloom-here {
  background: #fff7dc;
}
#cimeli > article.heirloom-elsewhere {
  background: #edf4f7;
}
#cimeli > article.heirloom-incomplete {
  background: #b3261e18;
}
.heirloom-location {
  display: block;
  margin: 0 0 0.55rem;
  font-weight: 700;
  color: #6a542f;
}
.heirloom-elsewhere .heirloom-location {
  color: #426274;
}
.message-dialog,
.direct-message-popup {
  width: min(34rem, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  overflow: auto;
  border: 2px solid #b98d3e;
  border-radius: 0.6rem;
  padding: 1.2rem;
}
.message-dialog::backdrop,
.direct-message-popup::backdrop {
  background: #0008;
}
.message-dialog .dialog-close,
.direct-message-popup .dialog-close {
  float: right;
  font-size: 1.5rem;
  background: transparent;
  color: #382d20;
}
.direct-message-popup p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.contribute-tools {
  clear: both;
}
.contribute-subject {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.4rem 0;
  padding: 0.45rem 0.6rem;
  background: #edf4f7;
  border-left: 4px solid #426274;
}
.contribute-subject img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
}
.contribute-menu {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.45rem;
  background: #fff7dc;
  border-bottom: 1px solid #b98d3e;
}
.contribute-menu button.active {
  background: #382d20;
}
.contribute-panel[hidden] {
  display: none;
}
.contribute-panel {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #b98d3e;
}
.contribute-panel > section {
  margin: 0;
}
.brand-with-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.brand-with-logo img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  transform: scale(1.35);
}
.header-guide {
  color: #fff;
}
.initially-hidden {
  display: none;
}
.guide {
  max-width: 850px;
}
.guide nav {
  position: sticky;
  top: 0;
  padding: 0.7rem;
  background: #f5f0e7;
  border-bottom: 1px solid #dfd3c1;
}
.guide li {
  margin: 0.4rem 0;
}
.guide .example {
  padding: 0.8rem;
  background: #fff7dc;
  border-left: 4px solid #b98d3e;
}

@media (max-width: 700px) {
  .external-person-row {
    grid-template-columns: 1fr;
  }
  .contribute-menu {
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
  }
  .contribute-menu button {
    flex: 0 0 auto;
  }
  .contribute-panel {
    padding-inline: 0;
  }
}
