:root {
  color-scheme: light;
  --ink: #172541;
  --navy: #102b5b;
  --blue: #2353a3;
  --gold: #a4772d;
  --muted: #5d6880;
  --border: #dce4ef;
  --paper: #f3f6fb;
  --white: #fff;
  --sans: "DM Sans", "Nirmala UI", "Noto Sans Bengali", system-ui, sans-serif;
  font: 15px/1.55 var(--sans);
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
svg { display: block; flex: none; }
[data-icon] { display: inline-grid; place-items: center; }
.icon { width: 18px; height: 18px; }
.topbar { background: #fff; border-bottom: 1px solid #e1e7f1; }
.top-inner, .container { width: min(1320px, 100% - 64px); margin-inline: auto; }
.top-inner {
  display: flex; min-height: 78px; justify-content: space-between; align-items: center; gap: 18px;
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 205px; color: var(--navy); }
.brand img { display: block; box-shadow: 0 4px 11px #122b581a; border-radius: 13px; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 19px; font-weight: 800; line-height: 1.2; }
.brand small { color: #697792; font-size: 11px; margin-top: 4px; letter-spacing: .035em; }
.nav { display: flex; justify-content: center; gap: 4px; }
.nav a {
  display: flex; align-items: center; gap: 7px; padding: 9px 12px;
  white-space: nowrap; border-radius: 8px; color: var(--muted); font-size: 14px; font-weight: 650;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--navy); background: #edf3ff; }
.nav a[aria-current="page"] .icon { stroke: #2353a3; }
.top-actions { display: flex; gap: 8px; align-items: center; }
.button {
  display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 8px;
  padding: 0 14px; border: 1px solid transparent; border-radius: 9px;
  font-weight: 720; font-size: 14px; white-space: nowrap;
}
.primary { color: #fff; background: var(--navy); border-color: var(--navy); box-shadow: 0 2px 5px #142b5522; }
.primary:hover { background: #204a8a; border-color: #204a8a; }
.outline { color: var(--navy); background: #fff; border-color: var(--border); }
.outline:hover { background: #f0f5fd; }
.compact { min-height: 34px; padding-inline: 10px; font-size: 12px; }
.compact .icon { width: 15px; height: 15px; }
.icon-button {
  display: grid; place-items: center; padding: 0; width: 34px; height: 34px;
  border: 0; border-radius: 8px; background: transparent; color: #455e86;
}
.icon-button:hover { color: var(--navy); background: #eef4fd; }
.settings { width: 42px; height: 42px; border: 1px solid var(--border); }
main { background: radial-gradient(ellipse 100% 500px at 50% 0, #e9f1ff, var(--paper) 95%); }
.container { padding-top: 24px; }
.hero {
  display: grid; position: relative; isolation: isolate; min-height: clamp(360px, 34.5vw, 480px);
  align-items: center; overflow: hidden; border: 1px solid #c9ab6d;
  border-radius: 19px; background: #aec7f8; box-shadow: 0 10px 39px #15386d18;
}
.hero-image, .hero::after { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; }
.hero-image { object-fit: fill; }
.hero::after {
  content: ""; z-index: -1;
  background: radial-gradient(ellipse 68% 89% at 15% 58%, #f7f0ffe6 5%, #e5ecffbc 38%, #e0eaff62 61%, transparent 79%);
}
.hero-content { padding: 52px 4.7% 41px; max-width: 59%; }
.hero-kicker {
  display: inline-flex; align-items: center; gap: 8px; background: #fff8e7e8; color: #69491a;
  border: 1px solid #dbbd80; padding: 4px 11px; border-radius: 30px; font-size: 12px; font-weight: 750;
}
.hero-kicker i, .example-badge i { width: 6px; height: 6px; background: #b5832f; transform: rotate(45deg); }
.hero h1 {
  margin: 12px 0 0; color: #142b59; font: 800 clamp(39px, 4.35vw, 67px)/1.14 var(--sans);
  letter-spacing: -.045em; overflow-wrap: anywhere; text-shadow: 0 1px 7px #ffffffaa;
}
.hero p { margin: 13px 0 20px; color: #293b63; font-size: clamp(14px, 1.35vw, 18px); font-weight: 600; }
.hero-link { border-color: #e6bb60; min-height: 45px; padding-inline: 13px; }
.hero-link .icon:last-child { color: #f4d98e; }
.panel { background: var(--white); border: 1px solid var(--border); border-radius: 13px; min-width: 0; box-shadow: 0 4px 16px #15356208; }
.search-panel {
  position: relative; margin: -24px 26px 0; padding: 17px 20px 18px;
  border-top: 2px solid #d2ac59; box-shadow: 0 11px 30px #16366114;
}
.search-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.search-heading h2, .panel-header h3 { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--navy); font-size: 17px; }
.section-icon { color: var(--blue); }
.search-heading .section-icon {
  width: 32px; height: 32px; background: #edf3ff; border: 1px solid #dce7ff; border-radius: 8px;
}
.shortcut { font-size: 12px; color: var(--muted); white-space: nowrap; }
kbd { margin-left: 4px; padding: 2px 5px; color: #506282; border: 1px solid #dce4ef; border-radius: 5px; background: #f8faff; font: 11px var(--sans); }
.search-form { display: grid; grid-template-columns: 1.15fr 1fr 1.15fr 1fr auto; gap: 11px; align-items: end; }
.field { display: grid; gap: 4px; min-width: 0; margin: 0; font-size: 13px; font-weight: 720; color: #25344f; }
.field input, .field select, .field textarea {
  width: 100%; min-width: 0; border: 1px solid #d8e2ef; border-radius: 8px;
  background: #f8fbff; min-height: 42px; color: var(--ink); padding: 7px 10px; font-size: 14px; font-weight: 400;
}
.field textarea { resize: vertical; }
.field small, .help-text { color: var(--muted); font-weight: 400; }
.archive { padding-top: 29px; scroll-margin-top: 15px; }
.archive-heading { display: flex; align-items: end; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.archive-heading h2 { margin: 0; color: var(--navy); font-size: clamp(26px, 2.8vw, 37px); line-height: 1.25; letter-spacing: -.03em; }
.tree-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-top: 8px; font-size: 13px; color: #516180; }
.tree-meta > span { display: flex; align-items: center; gap: 5px; }
.tree-meta .icon { width: 15px; height: 15px; color: #5274ae; }
.example-badge {
  display: inline-flex; gap: 8px; align-items: center; white-space: nowrap; padding: 4px 9px;
  border: 1px solid #e8d5a7; border-radius: 20px; background: #fff8e7; color: #72511d; font-size: 12px; font-weight: 750;
}
.workspace-grid { display: grid; grid-template-columns: minmax(0, 1fr) 323px; gap: 16px; align-items: start; }
.workspace-grid.no-profile { grid-template-columns: minmax(0, 1fr); }
.load-status { color: var(--muted); padding: 26px; text-align: center; }
.family-gate { padding: clamp(17px, 4vw, 35px); }
.family-gate h3 { color: var(--navy); margin: 0; font-size: 22px; }
.family-gate p { margin: 7px 0 15px; color: var(--muted); }
.gate-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.panel-header {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 55px; padding: 0 15px; border-bottom: 1px solid #e5ebf3;
}
.panel-header h3 { font-size: 15px; }
.tree-viewport {
  position: relative; overflow: hidden; touch-action: none; cursor: grab; isolation: isolate; min-height: 450px;
  height: clamp(450px, 52vw, 560px); border-radius: 0 0 12px 12px; background-color: #f7faff;
  background-image: radial-gradient(#cbd9ef 1px, transparent 1px); background-size: 17px 17px;
}
.tree-viewport.dragging { cursor: grabbing; user-select: none; }
.tree-scene { position: absolute; inset: 0 auto auto 0; transform-origin: 0 0; }
.tree-lines { position: absolute; inset: 0; overflow: visible; pointer-events: none; }
.descent { stroke: #7194c8; stroke-width: 1.6; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.partner { stroke: #b38032; stroke-width: 1.55; fill: none; }
.partner-disc { fill: #fff5d7; stroke: #d0a75e; stroke-width: 1; }
.generation-label {
  position: absolute; left: 50%; transform: translateX(-50%); padding: 2px 10px;
  white-space: nowrap; background: #edf4ff; border: 1px solid #cbdcf3; border-radius: 15px;
  color: #385681; font-size: 10px; font-weight: 750;
}
.person-node {
  position: absolute; display: flex; align-items: center; gap: 8px; text-align: left; padding: 7px 8px;
  color: var(--ink); border: 1px solid #d1dff2; border-radius: 10px; background: #fff; box-shadow: 0 3px 8px #19366b13;
}
.person-node:hover { border-color: #7297d7; background: #f5f9ff; }
.person-node[aria-pressed="true"] { border-color: #3365ab; background: #e9f2ff; box-shadow: 0 0 0 2px #7297dc32, 0 3px 6px #19366b15; }
.avatar {
  display: grid; place-items: center; width: 43px; height: 43px; flex: 0 0 auto;
  border-radius: 50%; overflow: hidden; background: #e6eeff; color: #264d90; font-size: 14px; font-weight: 800;
}
.avatar.warm { background: #fff1d5; color: #855b20; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.node-text { min-width: 0; }
.node-text strong, .node-text small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.node-text strong { font-size: 13px; }
.node-text small { font-size: 10.6px; color: #5c6c86; margin-top: 2px; }
.tree-controls, .tree-legend {
  position: absolute; bottom: 13px; display: flex; align-items: center;
  background: #fff; border: 1px solid var(--border); border-radius: 8px; color: #526381; box-shadow: 0 2px 5px #2545710e; cursor: default;
}
.tree-controls { left: 13px; }
.tree-controls output { min-width: 42px; text-align: center; font-size: 11px; font-weight: 750; border-inline: 1px solid #e5ebf3; }
.tree-legend { right: 13px; gap: 10px; font-size: 11px; padding: 7px 9px; }
.tree-legend span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.tree-legend i { width: 14px; height: 2px; background: #7194c8; border-radius: 4px; }
.tree-legend .partner-key { background: #b68b48; }
.tree-empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; text-align: center; padding: 25px; cursor: default; }
.tree-empty .icon { width: 29px; height: 29px; color: var(--blue); }
.tree-empty h3 { color: var(--navy); font-size: 23px; margin: 7px 0 2px; }
.tree-empty p { margin: 0 0 14px; color: var(--muted); }
.profile-content { padding: 15px; }
.profile-photo { height: 164px; margin: 0; border-radius: 10px; overflow: hidden; background: #e8f0ff; }
.profile-photo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 37%; }
.profile-name-block { display: flex; align-items: center; gap: 11px; margin: 0 0 12px; }
.profile-photo + .profile-name-block { margin-top: 12px; }
.profile-name-block .avatar { width: 51px; height: 51px; font-size: 17px; }
.profile-name { margin: 0; color: var(--navy); font-size: 23px; line-height: 1.2; overflow-wrap: anywhere; }
.profile-years { color: var(--muted); margin: 4px 0 0; font-size: 12px; }
.profile-facts { display: grid; gap: 8px; margin: 0; padding: 10px; background: #f2f6fd; border-radius: 8px; }
.profile-facts div { display: grid; grid-template-columns: 15px minmax(0, 1fr); gap: 7px; align-items: start; color: #435675; font-size: 12px; overflow-wrap: anywhere; }
.profile-facts strong { display: block; font-size: 11px; color: #5a6a86; font-weight: 650; }
.profile-facts .icon { width: 15px; height: 15px; margin-top: 2px; color: var(--blue); }
.profile-section { padding: 12px 0; border-bottom: 1px solid #e5ebf3; }
.profile-section h4 { margin: 0 0 5px; font-size: 13px; color: var(--navy); }
.profile-section p { margin: 0; color: var(--muted); font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.related { display: grid; gap: 3px; }
.related button {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: none;
  border: 0; border-radius: 6px; color: var(--ink); padding: 4px; font-size: 12px;
}
.related button:hover { background: #edf4ff; }
.related button small { margin-left: auto; color: var(--muted); white-space: nowrap; }
.related .avatar { width: 26px; height: 26px; font-size: 10px; }
.profile-edit { width: 100%; margin-top: 12px; min-height: 36px; }
.collection-panel { min-height: 250px; }
.people-list, .timeline-list { padding: 7px 13px; }
.person-row {
  display: flex; align-items: center; gap: 10px; min-height: 61px; width: 100%; text-align: left;
  border: 0; border-bottom: 1px solid #e6edf8; padding: 7px 8px; color: var(--ink); background: transparent;
}
.person-row:last-child { border-bottom: 0; }
.timeline-event:not(:last-child) { border-bottom: 1px solid #e6edf8; }
.person-row:hover, .person-row[aria-pressed="true"] { background: #eef4ff; border-radius: 8px; }
.person-row .row-text { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.person-row strong, .person-row small { display: block; }
.person-row small { margin-top: 2px; color: #586886; }
.person-row .icon { color: #6481b1; }
.timeline-event { display: grid; grid-template-columns: 57px minmax(0, 1fr); align-items: center; gap: 7px; }
.timeline-event time { color: var(--navy); font-size: 17px; font-weight: 750; text-align: center; }
.empty-message { padding: 20px; color: var(--muted); text-align: center; }
footer { display: flex; align-items: center; gap: 8px; margin-top: 28px; padding: 16px 0 22px; border-top: 1px solid #dce5f1; color: #526282; font-size: 12px; }
.footer-domain { margin-left: auto; }
dialog {
  width: min(584px, calc(100% - 26px)); max-height: calc(100dvh - 26px);
  color: var(--ink); background: #fff; border: 1px solid #d6e1f1; border-radius: 14px;
  padding: 0; box-shadow: 0 16px 63px #102b5b52;
}
dialog::backdrop { background: #112a596d; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 17px; border-bottom: 1px solid #e3eaf5; }
.dialog-head h2 { margin: 0; color: var(--navy); font-size: 22px; }
.dialog-body { padding: 15px 17px; }
.dialog-body > p:first-child { margin-top: 0; }
.dialog-body .field { margin-bottom: 10px; }
.auth-switch { margin-top: 12px; }
.request-list { display: grid; gap: 7px; }
.request-card {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center;
  padding: 9px; border: 1px solid var(--border); border-radius: 8px;
  color: var(--navy); background: #f8fbff; text-align: left;
}
.request-card:hover { background: #edf4ff; }
.request-card strong, .request-card small { display: block; overflow-wrap: anywhere; }
.request-card small, .request-details small { color: var(--muted); font-size: 12px; }
.request-status { padding: 2px 7px; border-radius: 8px; background: #eaf0fc; font-size: 11px; }
.request-details { margin-bottom: 12px; padding: 10px; border-radius: 8px; background: #f0f5fd; overflow-wrap: anywhere; }
.request-details p { margin: 4px 0; white-space: pre-wrap; }
.add-step { margin: 0 0 11px; color: #50698f; font-size: 12px; font-weight: 750; }
.parent-filters { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 9px; }
.parent-results { max-height: min(44dvh, 380px); overflow-y: auto; padding: 2px 4px; }
.parent-group + .parent-group { margin-top: 10px; }
.parent-group h3 { margin: 0 0 5px; color: var(--navy); font-size: 13px; }
.parent-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.parent-option {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 7px; align-items: center;
  min-height: 51px; padding: 5px 7px; border: 1px solid var(--border); border-radius: 8px;
  color: var(--ink); background: #f8fbff; text-align: left;
}
.parent-option:hover, .parent-option[aria-current="true"] { background: #e9f2ff; border-color: #82a0cd; }
.parent-option .avatar { width: 31px; height: 31px; font-size: 11px; }
.parent-option .icon { width: 15px; height: 15px; color: var(--blue); }
.parent-option strong, .parent-option small { display: block; line-height: 1.35; overflow-wrap: anywhere; }
.parent-option strong { font-size: 13px; }
.parent-option small { color: var(--muted); font-size: 11px; }
.filter-status { margin: 7px 4px 0; color: var(--muted); font-size: 12px; }
.dialog-actions.parent-actions { justify-content: space-between; }
.parent-summary {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 13px; padding: 7px 9px; border: 1px solid #d6e3f6; border-radius: 8px; background: #edf4ff; color: var(--navy);
}
.parent-summary > span { display: flex; align-items: center; gap: 6px; font-size: 13px; overflow-wrap: anywhere; }
.member-details { margin: 9px 0; border: 1px solid var(--border); border-radius: 8px; }
.member-details summary { cursor: pointer; color: var(--navy); padding: 9px 10px; font-size: 13px; font-weight: 720; }
.member-details > div { padding: 3px 10px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.form-section { margin: 5px 0 13px; min-width: 0; border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px 0; }
.form-section legend { color: var(--navy); font-size: 13px; font-weight: 750; padding-inline: 3px; }
.check { display: flex; align-items: center; gap: 6px; margin: 4px 0 10px; font-size: 13px; }
.form-error { color: #933729; font-size: 13px; }
.form-error:empty { display: none; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 7px; flex-wrap: wrap; margin-top: 12px; }
.danger { margin-right: auto; color: #913d34; background: #fff2ef; border-color: #f2d7d1; }
.danger:hover { background: #fdebdf; }
.settings-block { margin-top: 15px; padding-top: 11px; border-top: 1px solid var(--border); }
.settings-block h3 { margin: 0 0 4px; font-size: 15px; color: var(--navy); }
.settings-block p { margin: 0 0 9px; font-size: 13px; }
.notice {
  position: fixed; z-index: 2; right: 16px; bottom: 16px; max-width: min(370px, 100% - 32px);
  padding: 10px 13px; background: var(--navy); color: #fff; border-radius: 8px; box-shadow: 0 3px 12px #16366144;
}
.notice:empty { display: none; }
@media (max-width: 1050px) {
  .top-inner, .container { width: calc(100% - 36px); }
  .top-inner { gap: 8px; }
  .nav a { padding-inline: 7px; }
  .brand { min-width: 0; }
  .workspace-grid { grid-template-columns: minmax(0, 1fr) 280px; gap: 10px; }
  .search-panel { margin-inline: 15px; padding-inline: 13px; }
}
@media (max-width: 790px) {
  .top-inner { flex-wrap: wrap; padding: 9px 0; }
  .nav { order: 3; width: 100%; justify-content: flex-start; }
  .nav a { padding-inline: 9px; }
  .top-actions { margin-left: auto; }
  .container { padding-top: 14px; }
  .hero { min-height: 320px; }
  .hero-content { max-width: 65%; padding-inline: 5%; }
  .search-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search-form button { grid-column: 1 / -1; }
  .workspace-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 530px) {
  .top-inner, .container { width: calc(100% - 22px); }
  .top-inner { gap: 7px; }
  .brand { gap: 7px; }
  .brand img { width: 36px; height: 36px; }
  .brand strong { font-size: 15px; }
  .brand small { font-size: 10px; }
  .top-actions { gap: 5px; }
  .top-actions .button { font-size: 12px; min-height: 36px; padding-inline: 7px; gap: 4px; }
  .settings { width: 34px; height: 36px; }
  .nav a { font-size: 12px; padding: 6px 7px; gap: 5px; }
  .nav .icon, .top-actions .icon { width: 15px; height: 15px; }
  .hero { min-height: 312px; border-radius: 13px; }
  .hero-content { max-width: 83%; padding-left: 5%; }
  .hero-image { object-fit: cover; object-position: 59% 50%; }
  .hero::after { background: linear-gradient(85deg, #f3ecffd9, #e2eeffb8 43%, #dfeaff23 85%); }
  .hero h1 { font-size: clamp(32px, 7.9vw, 43px); }
  .hero p { margin: 9px 0 13px; }
  .hero-link { min-height: 38px; font-size: 12px; }
  .search-panel { margin: -10px 6px 0; padding: 11px 9px; }
  .shortcut { display: none; }
  .search-form { gap: 7px; }
  .search-form .field input, .search-form .field select { padding-inline: 6px; font-size: 13px; }
  .archive { padding-top: 20px; }
  .tree-meta { gap: 6px; font-size: 11px; }
  .tree-meta .icon { width: 13px; height: 13px; }
  .example-badge { font-size: 10px; padding-inline: 6px; }
  .tree-viewport { height: 385px; min-height: 385px; }
  .tree-legend { right: 7px; gap: 5px; padding-inline: 5px; font-size: 10px; }
  .tree-controls { left: 7px; }
  .profile-photo { height: clamp(150px, 47vw, 230px); }
}
@media (max-width: 365px) {
  .brand strong { font-size: 13px; }
  .top-actions .primary .icon { display: none; }
  .nav a { font-size: 11px; padding-inline: 5px; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .parent-options { grid-template-columns: minmax(0, 1fr); }
}
