:root {
  --paper:#f8f7f3;
  --white:#fff;
  --ink:#29382e;
  --muted:#7a8179;
  --line:#e1e4db;
  --green:#365d44;
  --pale:#edf2e9;
  --gold:#b39a6a;
  font-family:Arial,Helvetica,sans-serif;
  color:var(--ink);
  background:var(--paper);
  font-synthesis:none;
}
* {
  box-sizing:border-box;
}
body {
  margin:0;
}
button,input {
  font:inherit;
}
button {
  cursor:pointer;
}
button {
  color:inherit;
}
button:focus-visible,input:focus-visible,.canvas:focus-visible {
  outline:3px solid #b39a6a;
  outline-offset:3px;
}
.header {
  height:105px;
  padding:0 32px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  border-bottom:1px solid var(--line);
  background:var(--white);
}
.brand {
  display:flex;
  align-items:center;
  gap:19px;
}
.logo {
  height:58px;
  width:58px;
  border:1px dashed #b9c3b4;
  border-radius:6px;
  display:grid;
  place-items:center;
  font-size:10px;
  letter-spacing:2px;
  color:var(--muted);
}
.logo img {
  display:none;
  width:100%;
  height:100%;
  border-radius:5px;
  object-fit:contain;
}
.logo.has-logo {
  border-style:solid;
  padding:3px;
}
.logo.has-logo img { display:block; }
.logo.has-logo .logo-placeholder { display:none; }
.eyebrow {
  font-size:10px;
  letter-spacing:2px;
  font-weight:600;
  color:var(--muted);
}
h1,h2,h3,p {
  margin:0;
}
h1 {
  font-family:Georgia,serif;
  font-weight:400;
  font-size:29px;
  margin-top:5px;
}
h1 span {
  font:16px Arial,sans-serif;
  color:var(--muted);
}
.header-instruction {
  margin:0;
  max-width:190px;
  color:var(--muted);
  font-size:11px;
  line-height:1.45;
  text-align:right;
}
.workspace {
  height:calc(100dvh - 105px);
  min-height:550px;
  display:grid;
  grid-template-columns:255px minmax(300px,1fr) 285px;
}
.directory {
  display:flex;
  flex-direction:column;
  min-height:0;
  background:#fcfcf9;
  border-right:1px solid var(--line);
}
.directory-head {
  padding:27px 20px 12px;
}
.directory h2 {
  font-size:15px;
  font-weight:600;
  display:flex;
  align-items:center;
  gap:10px;
}
#count {
  font-size:11px;
  border:1px solid var(--line);
  padding:3px 7px;
  border-radius:12px;
  color:var(--muted);
}
.search-label {
  display:block;
  font-size:11px;
  margin:27px 0 9px;
  color:var(--muted);
}
#search {
  width:100%;
  padding:11px 9px;
  border:1px solid var(--line);
  background:white;
  border-radius:5px;
  font-size:12px;
  color:var(--ink);
}
.muted {
  color:var(--muted);
  font-size:11px;
  margin-top:16px;
}
.people {
  overflow:auto;
  flex:1;
  padding:0 10px 16px;
}
.person-item {
  display:flex;
  width:100%;
  gap:11px;
  padding:12px 10px;
  text-align:left;
  border:0;
  background:transparent;
  border-radius:5px;
  align-items:center;
}
.person-item:hover {
  background:#f0f1eb;
}
.person-item.selected {
  background:var(--pale);
}
.initials {
  width:32px;
  height:32px;
  flex-shrink:0;
  background:#eeeee7;
  display:grid;
  place-items:center;
  border-radius:50%;
  font-family:Georgia,serif;
  font-size:12px;
  color:#657261;
}
.person-item.selected .initials {
  background:var(--green);
  color:white;
}
.person-item strong {
  font-size:12px;
  font-weight:500;
  display:block;
  line-height:1.4;
}
.person-item small {
  font-size:10px;
  color:var(--muted);
  display:block;
  margin-top:3px;
}
.source-note {
  padding:17px 20px;
  border-top:1px solid var(--line);
  font-size:10px;
  color:var(--muted);
  line-height:1.7;
}
.tree-section {
  min-width:0;
  display:flex;
  flex-direction:column;
}
.tree-header {
  padding:27px 25px 23px;
  display:flex;
  gap:15px;
  align-items:center;
  justify-content:space-between;
  background:var(--paper);
}
.tree-header h2 {
  font-family:Georgia,serif;
  font-weight:400;
  font-size:24px;
  margin-top:8px;
}
.canvas {
  position:relative;
  flex:1;
  overflow:hidden;
  background-image:radial-gradient(#c9d0c4 0.7px,transparent 0.7px);
  background-size:20px 20px;
  touch-action:none;
  cursor:grab;
  min-height:360px;
  user-select:none;
  -webkit-user-select:none;
}
.canvas * { user-select:none; -webkit-user-select:none; }
.canvas.dragging {
  cursor:grabbing;
}
.world {
  position:absolute;
  transform-origin:0 0;
  will-change:transform;
}
.world svg {
  position:absolute;
  overflow:visible;
  pointer-events:none;
}
.node {
  position:absolute;
  width:196px;
  min-height:100px;
  height:100px;
  border:1px solid #d5ddcf;
  border-radius:7px;
  padding:13px 14px;
  text-align:left;
  background:#fff;
  box-shadow:0 3px 10px #29382e06;
  cursor:pointer;
}
.node:hover {
  border-color:var(--green);
  box-shadow:0 4px 15px #29382e15;
}
.node.selected {
  background:var(--green);
  border-color:var(--green);
  color:white;
}
.node .node-id {
  display:block;
  font-size:10px;
  letter-spacing:1px;
  color:var(--muted);
  margin-bottom:7px;
}
.node strong {
  font-family:Georgia,serif;
  font-weight:400;
  font-size:18px;
  line-height:1.15;
  display:block;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.node-surname {
  display:block;
  font-size:13px;
  line-height:1.25;
  margin-top:2px;
  font-weight:600;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.node small {
  display:block;
  font-size:11px;
  color:var(--muted);
  margin-top:6px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.node.selected small,.node.selected .node-id {
  color:#d0dfcb;
}
.node.selected .node-surname {
  color:#e4eee0;
}
.zoom-controls {
  position:absolute;
  right:20px;
  bottom:20px;
  display:flex;
  align-items:center;
  background:white;
  border:1px solid var(--line);
  border-radius:5px;
  box-shadow:0 2px 6px #00000005;
}
.zoom-controls button {
  width:34px;
  height:34px;
  border:0;
  background:none;
  font-size:20px;
}
.zoom-controls button:hover {
  background:var(--pale);
}
#zoom-level {
  width:38px;
  text-align:center;
  font-size:10px;
  color:var(--muted);
}
#fit {
  border-left:1px solid var(--line);
  font-size:22px;
}
.tree-footer {
  display:flex;
  justify-content:space-between;
  gap:10px;
  font-size:10px;
  color:var(--muted);
  padding:15px 22px;
  border-top:1px solid var(--line);
}
.details {
  background:white;
  border-left:1px solid var(--line);
  overflow:auto;
  padding:27px 24px;
}
.profile-initials {
  margin:25px 0 18px;
  width:62px;
  height:62px;
  background:var(--pale);
  color:var(--green);
  border-radius:50%;
  font-family:Georgia,serif;
  font-size:23px;
  display:grid;
  place-items:center;
}
.details h2 {
  font-family:Georgia,serif;
  font-size:26px;
  font-weight:400;
  line-height:1.2;
}
.profile-id {
  margin:10px 0 25px;
  font-size:11px;
  color:var(--muted);
}
.details dl {
  padding:20px 0 4px;
  border-top:1px solid var(--line);
  margin:0;
}
.details dt {
  font-size:10px;
  color:var(--muted);
  margin-bottom:5px;
}
.details dd {
  margin:0 0 18px;
  font-size:12px;
  line-height:1.5;
}
.details h3 {
  font-size:11px;
  font-weight:600;
  margin:20px 0 12px;
}
.notes {
  font-size:12px;
  line-height:1.7;
  color:#636c60;
  background:var(--paper);
  padding:13px;
  border-radius:4px;
  white-space:pre-line;
}
.relation-link {
  display:block;
  width:100%;
  text-align:left;
  border:0;
  border-bottom:1px solid #f0f1eb;
  background:none;
  padding:9px 0;
  font-size:12px;
  line-height:1.4;
  color:var(--green);
}
.relation-link:hover {
  text-decoration:underline;
}
.relation-link small {
  display:block;
  color:var(--muted);
  font-size:10px;
  margin-top:4px;
}
.empty-list {
  padding:20px 10px;
  font-size:12px;
  line-height:1.6;
  color:var(--muted);
}
.empty-tree {
  padding:35px;
  color:var(--muted);
  font-size:13px;
}
.status {
  position:fixed;
  bottom:18px;
  left:50%;
  transform:translateX(-50%);
  z-index:5;
  background:var(--ink);
  color:white;
  padding:13px 20px;
  border-radius:5px;
  font-size:13px;
  max-width:90vw;
  box-shadow:0 5px 20px #0002;
}
html,body {
  width:100%;
  max-width:100%;
  overflow-x:clip;
  overscroll-behavior-x:none;
}
body {
  overscroll-behavior-x:none;
}
.workspace>* {
  min-width:0;
}
.canvas {
  overscroll-behavior:none;
  isolation:isolate;
  contain:layout paint;
}
.world {
  width:0;
  height:0;
}
.world svg {
  width:1px;
  height:1px;
}
.node {
  height:108px;
  min-height:108px;
}
.node.unknown {
  background:#e9ebe7;
  border-color:#cfd4ca;
  color:#7a8179;
  box-shadow:none;
  cursor:default;
}
.node.unknown .node-id {
  font-size:17px;
  line-height:15px;
  margin-bottom:5px;
}
.node.unknown strong {
  font-family:Arial,sans-serif;
  font-size:12px;
}
.home-button {
  border:1px solid var(--line);
  background:white;
  padding:10px 12px;
  border-radius:5px;
  font-size:11px;
  flex-shrink:0;
}
.home-button:hover {
  background:var(--pale);
}
.people,.details {
  overscroll-behavior:contain;
}
.tree-footer {
  line-height:1.5;
}
@media(min-width:1500px) {
  .workspace {
    grid-template-columns:285px minmax(300px,1fr) 315px;
  }
  .header {
    padding:0 40px;
  }
}
@media(max-width:1100px) {
  .workspace {
    grid-template-columns:215px minmax(300px,1fr);
  }
  .details {
    grid-column:1/-1;
    border-top:1px solid var(--line);
    overflow:visible;
  }
  .workspace {
    height:auto;
    min-height:calc(100dvh - 105px);
  }
  .directory,.tree-section {
    height:calc(100dvh - 105px);
    min-height:540px;
  }
  .details dl {
    display:grid;
    grid-template-columns:110px 1fr;
    align-items:baseline;
  }
  .details dd {
    margin-bottom:12px;
  }
  .tree-footer span:last-child {
    display:none;
  }
}
@media(max-width:640px) {
  .header {
    height:90px;
    padding:0 16px;
  }
  .logo {
    width:42px;
    height:46px;
    font-size:8px;
  }
  .brand {
    gap:10px;
  }
  h1 {
    font-size:23px;
  }
  h1 span {
    display:none;
  }
  .eyebrow {
    font-size:8px;
    letter-spacing:1.5px;
  }
  .header-instruction { max-width:130px; font-size:10px; }
  .workspace {
    display:flex;
    flex-direction:column;
  }
  .directory {
    height:auto;
    min-height:0;
    border-right:0;
    border-bottom:1px solid var(--line);
  }
  .directory-head {
    padding:17px 16px 8px;
  }
  .search-label {
    margin:12px 0 6px;
  }
  .muted {
    margin-top:9px;
  }
  .people {
    display:flex;
    max-height:105px;
    overflow:auto;
    padding:0 8px 9px;
    flex:none;
  }
  .person-item {
    width:190px;
    flex-shrink:0;
  }
  .source-note {
    display:none;
  }
  .tree-section {
    height:540px;
    min-height:540px;
  }
  .tree-header {
    padding:20px 16px;
  }
  .tree-header h2 {
    font-size:21px;
  }
  .zoom-controls {
    right:13px;
    bottom:14px;
  }
  .tree-footer {
    padding:12px 16px;
  }
  .details {
    padding:25px 22px;
  }
}
