/* HUMANIDAD — Persona viva v1 (person-experience-v1.css)
 *
 * Presentación de: tarjeta de persona del árbol, camino de linaje, drawer (vista rápida),
 * perfil completo y visor de fotografías. Solo presentación: ninguna regla de datos, acceso ni auth.
 * Lenguaje: negro profundo, azul casi negro, marfil y champán. Sin bordes en todo, sin cajas dentro
 * de cajas, sin neón. Se carga DESPUÉS de la capa visual final para ganar de forma determinista.
 */
:root {
  --hpx-ink: #05070b;
  --hpx-ink-2: #090d14;
  --hpx-ink-3: #0f141d;
  --hpx-ivory: #f3ede0;
  --hpx-ivory-dim: #cfc7b7;
  --hpx-mute: #9095a0;
  --hpx-champagne: #d9c08a;
  --hpx-champagne-hi: #ecd9a8;
  --hpx-champagne-a: rgba(217, 192, 138, .14);
  --hpx-champagne-line: rgba(217, 192, 138, .24);
  --hpx-line: rgba(255, 255, 255, .07);
  --hpx-error: #f0a893;
  --hpx-sans: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --hpx-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --hpx-ease: cubic-bezier(.22, .7, .2, 1);
}

/* ═══════════════ 1 · Piezas compartidas ═══════════════ */
.hpx-ico { display: inline-grid; place-items: center; width: 1.15em; height: 1.15em; flex: none; }
.hpx-ico svg { display: block; width: 100%; height: 100%; }

.hpx-btn {
  appearance: none; -webkit-appearance: none;
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 44px; margin: 0; padding: 0 22px; border: 0; border-radius: 999px;
  font: 600 13.5px/1.1 var(--hpx-sans); letter-spacing: .01em;
  color: var(--hpx-ivory); background: transparent; text-decoration: none; text-align: center;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background-color .28s var(--hpx-ease), color .28s var(--hpx-ease), box-shadow .28s var(--hpx-ease), transform .28s var(--hpx-ease), opacity .2s;
}
.hpx-btn .hpx-ico { font-size: 1.15em; }
.hpx-btn--primary {
  color: #17130b !important;
  background: linear-gradient(180deg, #f6ecd0 0%, #dcc38a 100%) !important;
  box-shadow: 0 10px 28px rgba(217, 192, 138, .18), inset 0 1px 0 rgba(255, 255, 255, .55) !important;
}
.hpx-btn--primary:hover { transform: translateY(-1px); box-shadow: 0 14px 34px rgba(217, 192, 138, .28), inset 0 1px 0 rgba(255, 255, 255, .6) !important; }
.hpx-btn--ghost {
  color: var(--hpx-champagne-hi) !important;
  background: var(--hpx-champagne-a) !important;
  box-shadow: inset 0 0 0 1px var(--hpx-champagne-line) !important;
}
.hpx-btn--ghost:hover { background: rgba(217, 192, 138, .22) !important; }
.hpx-btn--quiet {
  min-height: 40px; padding: 0 16px; font-size: 12.5px; font-weight: 600;
  color: var(--hpx-ivory-dim) !important; background: rgba(255, 255, 255, .045) !important; box-shadow: none !important;
}
.hpx-btn--quiet:hover { color: var(--hpx-ivory) !important; background: rgba(255, 255, 255, .09) !important; }
.hpx-btn--link {
  min-height: 44px; padding: 0; justify-content: flex-start;
  color: var(--hpx-champagne-hi) !important; background: none !important; box-shadow: none !important;
}
.hpx-btn--link .hpx-ico { transition: transform .3s var(--hpx-ease); }
.hpx-btn--link:hover .hpx-ico { transform: translateX(4px); }
.hpx-btn[aria-busy="true"] { opacity: .72; cursor: progress; }
.hpx-btn[aria-disabled="true"]:not([aria-busy="true"]) { opacity: .5; cursor: not-allowed; }

.hpx-btn:focus-visible, .hpx-chip:focus-visible, .hpx-link:focus-visible, .hpx-tab:focus-visible,
.hpx-thumb:focus-visible, .hpx-memory:focus-visible, .hpx-back:focus-visible,
.hpx-manage-summary:focus-visible, .hpx-viewer button:focus-visible, .hpx-side-btn:focus-visible {
  outline: 2px solid var(--hpx-champagne-hi) !important; outline-offset: 3px !important;
}

/* Retrato: foto o iniciales sobre una esfera de luz muy sutil (nunca un icono de usuario) */
.hpx-portrait {
  --hpx-size: 56px;
  position: relative; flex: none; width: var(--hpx-size); height: var(--hpx-size);
  border-radius: 50%; overflow: hidden; isolation: isolate;
  background:
    radial-gradient(circle at var(--hpx-lx, 40%) var(--hpx-ly, 28%), rgba(255, 238, 196, .34) 0, rgba(217, 192, 138, .10) 34%, transparent 64%),
    linear-gradient(160deg, #1a2231, #0b0f17 72%);
  box-shadow: inset 0 0 0 1px rgba(217, 192, 138, .24), 0 0 0 4px rgba(217, 192, 138, .045), 0 12px 30px rgba(0, 0, 0, .42);
}
.hpx-portrait-initials, .hpx-initials {
  position: absolute; inset: 0; display: grid; place-items: center;
  font: 500 calc(var(--hpx-size) * .34)/1 var(--hpx-serif); letter-spacing: .04em; color: var(--hpx-ivory);
  transition: opacity .4s;
}
.hpx-portrait-img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .55s var(--hpx-ease);
}
.hpx-portrait.has-photo .hpx-portrait-img { opacity: 1; }
.hpx-portrait.has-photo .hpx-portrait-initials { opacity: 0; }
.hpx-portrait--xs { --hpx-size: 32px; }
.hpx-portrait--sm { --hpx-size: 44px; }
.hpx-portrait--md { --hpx-size: 56px; }
.hpx-portrait--lg { --hpx-size: 84px; }
.hpx-portrait--xl { --hpx-size: 148px; }
.hpx-portrait.is-memorial {
  box-shadow: inset 0 0 0 1px rgba(255, 244, 214, .6), 0 0 0 5px rgba(255, 244, 214, .06), 0 0 38px rgba(255, 238, 200, .24);
}
.hpx-portrait.is-memorial .hpx-portrait-initials { color: #fff6de; }

/* Textos de apoyo */
html body .hpx-eyebrow {
  margin: 0 0 14px !important; font: 700 10px/1 var(--hpx-sans) !important; letter-spacing: .18em !important; text-transform: uppercase !important; color: var(--hpx-mute) !important; text-shadow: none !important;
}
.hpx-empty { display: grid; gap: 8px; justify-items: start; padding: 4px 0; }
.hpx-empty-text { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--hpx-mute); }
.hpx-note { margin: 18px 0 0; font-size: 12.5px; line-height: 1.55; color: var(--hpx-mute); }
.hpx-status { display: none; margin: 10px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--hpx-ivory-dim); }
.hpx-status.is-visible, .hpx-message[data-hpx-message="loading"] .hpx-status { display: block; }
.hpx-status.is-soft { color: var(--hpx-mute); }
.hpx-status.is-error { color: var(--hpx-error); }

/* Estado de la persona (el frontend explica; el backend decide) */
.hpx-state[hidden] { display: none !important; }
.hpx-state { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.hpx-pill {
  padding: 7px 12px; border-radius: 999px; font: 700 10px/1 var(--hpx-sans); letter-spacing: .13em; text-transform: uppercase;
  color: var(--hpx-champagne-hi); background: var(--hpx-champagne-a);
}
[data-hpx-state-kind="memorial"] > .hpx-pill { color: #fff4d8; background: rgba(255, 246, 222, .12); }
[data-hpx-state-kind="blocked"] > .hpx-pill, [data-hpx-state-kind="unverified"] > .hpx-pill { color: var(--hpx-mute); background: rgba(255, 255, 255, .06); }
.hpx-state-text { flex: 1 1 220px; min-width: 0; font-size: 13px; line-height: 1.55; color: var(--hpx-mute); }

/* Números reales (nunca inventados) */
.hpx-metrics { display: flex; flex-wrap: wrap; gap: 16px 34px; margin: 0; padding: 0; list-style: none; }
.hpx-metrics[hidden] { display: none; }
.hpx-metric { display: grid; gap: 6px; }
.hpx-metric-num { font: 500 28px/1 var(--hpx-serif); color: var(--hpx-ivory); font-variant-numeric: lining-nums tabular-nums; }
.hpx-metric-label { font: 600 10px/1 var(--hpx-sans); letter-spacing: .15em; text-transform: uppercase; color: var(--hpx-mute); }

/* Carga */
.hpx-skel-wrap { display: grid; gap: 8px; }
.hpx-skel-wrap--grid { grid-template-columns: repeat(3, 1fr); }
.hpx-skel-wrap--metrics { display: flex; gap: 24px; }
.hpx-skel {
  display: block; min-height: 18px; border-radius: 12px;
  background: linear-gradient(100deg, rgba(255, 255, 255, .04) 30%, rgba(255, 255, 255, .10) 50%, rgba(255, 255, 255, .04) 70%) 0 0 / 220% 100%;
  animation: hpx-shimmer 1.6s linear infinite;
}
.hpx-skel-wrap--grid .hpx-skel { aspect-ratio: 1; }
.hpx-skel--num { width: 36px; height: 26px; }
@keyframes hpx-shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }

/* Fotografías */
.hpx-thumbs, .hpx-photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.hpx-thumb {
  position: relative; display: block; aspect-ratio: 1; margin: 0; padding: 0; border: 0; border-radius: 14px; overflow: hidden;
  background: linear-gradient(160deg, #141b27, #0a0e15); cursor: zoom-in; transition: transform .35s var(--hpx-ease), box-shadow .35s;
}
.hpx-thumb:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(0, 0, 0, .5); }
.hpx-thumb-img { display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .5s var(--hpx-ease), transform .8s var(--hpx-ease); }
.hpx-thumb:not(.is-loading) .hpx-thumb-img { opacity: 1; }
.hpx-thumb:hover .hpx-thumb-img { transform: scale(1.04); }
.hpx-thumb.is-loading::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .07) 50%, transparent 70%) 0 0 / 220% 100%; animation: hpx-shimmer 1.6s linear infinite; }
.hpx-thumb.is-error .hpx-thumb-img { display: none; }
.hpx-thumb-fail { position: absolute; inset: 0; display: grid; place-items: center; padding: 8px; font-size: 11px; color: var(--hpx-mute); text-align: center; }
.hpx-thumb-more { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(5, 7, 11, .6); font: 500 22px/1 var(--hpx-serif); color: var(--hpx-ivory); }

/* Datos clave */
.hpx-facts { display: grid; gap: 0; margin: 0; }
.hpx-fact { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 16px; padding: 13px 0; border-top: 1px solid var(--hpx-line); }
.hpx-fact:first-child { border-top: 0; }
.hpx-fact-label { margin: 0; font: 700 10px/1.6 var(--hpx-sans); letter-spacing: .15em; text-transform: uppercase; color: var(--hpx-mute); }
.hpx-fact-value { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--hpx-ivory); overflow-wrap: anywhere; }
.hpx-fact-sub { display: block; margin-top: 2px; font-size: 12.5px; color: var(--hpx-mute); }
.hpx-facts--compact .hpx-fact { padding: 11px 0; }
.hpx-facts--compact .hpx-fact-value { font-size: 14px; }
.hpx-link {
  appearance: none; display: inline; margin: 0; padding: 0; border: 0; background: none; font: inherit; color: var(--hpx-champagne-hi);
  text-decoration: underline; text-decoration-color: rgba(217, 192, 138, .35); text-underline-offset: 3px; cursor: pointer;
  transition: text-decoration-color .25s, color .25s;
}
.hpx-link:hover { color: #fff3d0; text-decoration-color: currentColor; }

/* Familia: cada persona es un botón real */
.hpx-famgroup { margin: 0 0 20px; }
.hpx-famgroup:last-child { margin-bottom: 0; }
.hpx-famgroup-title { margin: 0 0 10px; font: 600 12px/1 var(--hpx-sans); letter-spacing: .04em; color: var(--hpx-ivory-dim); }
.hpx-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.hpx-chips-more { align-self: center; padding: 0 8px; font-size: 12px; color: var(--hpx-mute); }
.hpx-chip {
  appearance: none; display: inline-flex; align-items: center; gap: 10px; max-width: 100%; margin: 0; padding: 6px 16px 6px 6px;
  border: 0; border-radius: 999px; font: inherit; text-align: left; color: var(--hpx-ivory); cursor: pointer;
  background: rgba(255, 255, 255, .045); transition: background-color .28s var(--hpx-ease), transform .28s var(--hpx-ease);
}
.hpx-chip:hover { background: rgba(217, 192, 138, .13); transform: translateY(-1px); }
.hpx-chip-copy { display: grid; gap: 2px; min-width: 0; }
.hpx-chip-name { font-size: 13.5px; font-weight: 600; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hpx-chip-sub { font-size: 11.5px; line-height: 1.2; color: var(--hpx-mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hpx-chip-flag { font-size: 10.5px; line-height: 1.2; letter-spacing: .04em; color: var(--hpx-champagne); }
.hpx-chip.is-uncertain { background: transparent; box-shadow: inset 0 0 0 1px rgba(217, 192, 138, .3); }
.hpx-chip--md { padding: 10px 20px 10px 10px; border-radius: 22px; width: 100%; }
.hpx-chip--md .hpx-chip-name { font-size: 15px; }
.hpx-chip--md .hpx-chip-sub { font-size: 12.5px; }
.hpx-chip[aria-current="true"] { background: var(--hpx-champagne-a); }

/* Recuerdos */
.hpx-memories { display: grid; gap: 10px; }
.hpx-memories--wide { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.hpx-memory {
  appearance: none; display: grid; gap: 7px; margin: 0; padding: 16px 18px; border: 0; border-radius: 18px; text-align: left; font: inherit; color: var(--hpx-ivory); cursor: pointer;
  background: linear-gradient(160deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .018)); transition: transform .3s var(--hpx-ease), background-color .3s;
}
.hpx-memory:hover { transform: translateY(-2px); background: linear-gradient(160deg, rgba(217, 192, 138, .12), rgba(255, 255, 255, .025)); }
.hpx-memory-meta { font: 700 10px/1.4 var(--hpx-sans); letter-spacing: .13em; text-transform: uppercase; color: var(--hpx-champagne); }
.hpx-memory-title { font: 600 17px/1.25 var(--hpx-serif); color: var(--hpx-ivory); }
.hpx-memory-excerpt { font-size: 13px; line-height: 1.55; color: var(--hpx-mute); }

/* ═══════════════ 2 · Tarjeta de persona del árbol ═══════════════ */
#HumanidadFamilyChart .card .humanidad-f3-card.hpx-card {
  width: 144px !important; height: 122px !important; padding: 8px 8px 6px !important;
  display: flex !important; flex-direction: column !important; align-items: center !important; justify-content: flex-start !important; gap: 0 !important;
  border: 0 !important; border-radius: 24px !important; text-align: center !important; cursor: pointer;
  background: linear-gradient(180deg, rgba(255, 255, 255, .038), rgba(255, 255, 255, .008)) !important; box-shadow: none !important;
  transition: background-color .4s var(--hpx-ease), transform .4s var(--hpx-ease), opacity .5s var(--hpx-ease) !important;
}
#HumanidadFamilyChart .card:hover .humanidad-f3-card.hpx-card { background: linear-gradient(180deg, rgba(217, 192, 138, .10), rgba(255, 255, 255, .015)) !important; transform: translateY(-2px); }
#HumanidadFamilyChart .card .hpx-card .humanidad-f3-avatar.hpx-portrait {
  --hpx-size: 50px; width: 50px !important; height: 50px !important; flex: 0 0 50px !important; margin: 0 0 6px !important; padding: 0 !important; border: 0 !important; border-radius: 50%;
  font-size: inherit !important; background-color: transparent;
  box-shadow: inset 0 0 0 1px rgba(150, 165, 190, .26), 0 8px 22px rgba(0, 0, 0, .4) !important;
}
#HumanidadFamilyChart .hpx-card.shape-square .humanidad-f3-avatar.hpx-portrait { border-radius: 16px !important; }
#HumanidadFamilyChart .hpx-card.shape-diamond .humanidad-f3-avatar.hpx-portrait { border-radius: 8px !important; transform: rotate(45deg) scale(.86); }
#HumanidadFamilyChart .hpx-card.shape-diamond .humanidad-f3-avatar.hpx-portrait > * { transform: rotate(-45deg) scale(1.16); }
#HumanidadFamilyChart .hpx-card .humanidad-f3-avatar.hpx-portrait > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .5s var(--hpx-ease); }
#HumanidadFamilyChart .hpx-card .humanidad-f3-avatar.hpx-portrait.has-photo > img { opacity: 1; }
#HumanidadFamilyChart .hpx-card .humanidad-f3-avatar.hpx-portrait > img:not([src]) { display: none; }
#HumanidadFamilyChart .hpx-card .humanidad-f3-avatar.hpx-portrait.has-photo > .hpx-initials { opacity: 0; }
/* Estado de la persona en la luz del retrato: conectado = champán, por conectar = azul frío, en memoria = marfil */
#HumanidadFamilyChart .hpx-card.is-connected .humanidad-f3-avatar.hpx-portrait { box-shadow: inset 0 0 0 1px rgba(217, 192, 138, .55), 0 0 0 4px rgba(217, 192, 138, .07), 0 8px 22px rgba(0, 0, 0, .4) !important; }
#HumanidadFamilyChart .hpx-card.is-memorial .humanidad-f3-avatar.hpx-portrait { box-shadow: inset 0 0 0 1px rgba(255, 244, 214, .7), 0 0 0 5px rgba(255, 244, 214, .07), 0 0 30px rgba(255, 238, 200, .3) !important; }
#HumanidadFamilyChart .hpx-card.is-memorial .hpx-initials { color: #fff6de; }
#HumanidadFamilyChart .hpx-card.is-main .humanidad-f3-avatar.hpx-portrait { box-shadow: inset 0 0 0 1.5px rgba(236, 217, 168, .9), 0 0 0 6px rgba(217, 192, 138, .10), 0 0 34px rgba(217, 192, 138, .28) !important; }
#HumanidadFamilyChart .hpx-card.is-main { background: radial-gradient(ellipse at 50% 26%, rgba(217, 192, 138, .16), transparent 70%) !important; }
#HumanidadFamilyChart .hpx-card .ht-memory-light {
  position: absolute; top: 8px; right: calc(50% - 40px); left: auto; z-index: 2; margin: 0; padding: 0; font-size: 12px; line-height: 1; font-style: normal; color: #fff3d0; text-shadow: 0 0 10px rgba(255, 238, 200, .8); background: none; box-shadow: none;
}
#HumanidadFamilyChart .hpx-card strong {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 100%;
  font: 600 12.5px/1.15 var(--hpx-sans) !important; letter-spacing: 0; color: var(--hpx-ivory) !important;
}
#HumanidadFamilyChart .hpx-card .humanidad-f3-role { display: block; margin-top: 3px !important; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 500 10.5px/1.2 var(--hpx-sans) !important; color: var(--hpx-champagne) !important; letter-spacing: .01em; }
#HumanidadFamilyChart .hpx-card .humanidad-f3-life { display: block; margin-top: 2px !important; font: 500 10px/1.2 var(--hpx-sans) !important; color: var(--hpx-mute) !important; font-variant-numeric: tabular-nums; }
#HumanidadFamilyChart .hpx-card .hpx-memorial-note { display: block; margin-top: 2px; font: 700 8.5px/1.2 var(--hpx-sans); letter-spacing: .14em; text-transform: uppercase; color: #f4ead0; }
#HumanidadFamilyChart .hpx-card .f3-quality-dot { top: 6px !important; right: 8px !important; left: auto !important; }

/* Camino de linaje: la persona elegida se enciende; su camino, ancestros y descendientes siguen visibles; el resto se apaga con suavidad */
.humanidad-f3-stage .card { transition: opacity .55s var(--hpx-ease); }
.humanidad-f3-stage.hpx-lineage-on .card { opacity: .3; }
.humanidad-f3-stage.hpx-lineage-on .card.hpx-l-in { opacity: 1; }
.humanidad-f3-stage.hpx-lineage-on .card.hpx-l-path .humanidad-f3-card.hpx-card { background: linear-gradient(180deg, rgba(217, 192, 138, .10), rgba(255, 255, 255, .012)) !important; }
.humanidad-f3-stage.hpx-lineage-on .card.hpx-l-selected .humanidad-f3-card.hpx-card {
  background: radial-gradient(ellipse at 50% 28%, rgba(236, 217, 168, .22), rgba(255, 255, 255, .02) 72%) !important;
  transform: translateY(-3px) scale(1.04);
}
.humanidad-f3-stage.hpx-lineage-on .card.hpx-l-selected .humanidad-f3-avatar.hpx-portrait { box-shadow: inset 0 0 0 2px rgba(255, 240, 200, .95), 0 0 0 7px rgba(236, 217, 168, .12), 0 0 40px rgba(236, 217, 168, .38) !important; }
.humanidad-f3-stage.hpx-lineage-on .links_view .link.hpx-link-dim { stroke-opacity: .1 !important; filter: none !important; }
.humanidad-f3-stage.hpx-lineage-on .links_view .link.hpx-link-lit { stroke-opacity: 1 !important; stroke-width: 2.2px !important; }
/* Rama materna / paterna (solo si el modelo la establece) */
.humanidad-f3-stage.hpx-side-on .card.hpx-s-out { opacity: .2; }
.humanidad-f3-stage.hpx-side-on .links_view .link.hpx-link-side-out { stroke-opacity: .08 !important; filter: none !important; }
/* Vínculo por confirmar / en disputa: línea punteada */
#HumanidadFamilyChart .links_view .link.hv4-link-uncertain { stroke-dasharray: 5 7 !important; }
/* Un enlace de pareja es una unión discreta y horizontal; los de progenitor→hijo siguen verticales (motor) */
#HumanidadFamilyChart .links_view .link.hv4-link-partner { stroke-width: 1.6px !important; opacity: .9 !important; }
/* Memorial: la luz sigue encendida en el enlace, no gris */
#HumanidadFamilyChart .links_view .link.hv4-link-memorial { stroke: #e7dcc0 !important; opacity: .62 !important; filter: drop-shadow(0 0 4px rgba(255, 244, 214, .22)) !important; }

/* El lienzo del árbol ocupa el alto disponible: sin esto la barra de controles (Mi familia · rama · zoom) quedaba
   centrada con desborde hacia arriba, oculta bajo el encabezado fijo. */
.account-view[data-view="tree"].active #familyMemberList { justify-content: flex-start; }
.account-view[data-view="tree"].active #familyMemberList > .humanidad-f3-shell { flex: 1 1 0; min-height: 0; margin-top: 0; }
.account-view[data-view="tree"].active #familyMemberList > .humanidad-f3-shell > .humanidad-f3-stage { flex: 1 1 0; min-height: 0; }
/* Una regla heredada (body.internal-product-v1-ready) limitaba el lienzo a 680px y lo centraba como una caja dentro del taller: el árbol ocupa todo el taller. */
html body.internal-product-v1-ready .account-view[data-view="tree"].active #familyMemberList > .humanidad-f3-shell > .humanidad-f3-stage { max-width: none !important; width: 100% !important; margin: 0 !important; }
/* La tarjeta no repite estados: el anillo del retrato ya los dice */
#HumanidadFamilyChart .card .humanidad-f3-card.hpx-card::after { display: none !important; }
#HumanidadFamilyChart .hpx-card .f3-quality-dot.confirmed { display: none !important; }

/* Foco por teclado en cada persona */
#HumanidadFamilyChart .card[data-id] { outline: none; }
#HumanidadFamilyChart .card[data-id]:focus-visible .humanidad-f3-card.hpx-card { box-shadow: 0 0 0 2px var(--hpx-champagne-hi) !important; }

/* Selector de rama */
.hpx-side-group:not([hidden]) { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 999px; background: rgba(255, 255, 255, .05); }
.hpx-side-group .hpx-side-btn { min-height: 30px; padding: 0 13px; border: 0 !important; border-radius: 999px !important; background: transparent !important; box-shadow: none !important; color: var(--hpx-ivory-dim) !important; font-size: 11.5px; }
.hpx-side-group .hpx-side-btn[aria-pressed="true"] { background: var(--hpx-champagne-a) !important; color: var(--hpx-champagne-hi) !important; box-shadow: inset 0 0 0 1px var(--hpx-champagne-line) !important; }
.hpx-side-group .hpx-side-btn:disabled { opacity: .38; cursor: help; }
/* Leyenda: en memoria = marfil */
.f3-state-legend i.memorial { background: #f4ead0 !important; box-shadow: 0 0 8px rgba(255, 244, 214, .7) !important; }

/* Navegador por familiares (pantallas estrechas): se recorre el árbol sin pellizcar */
.hpx-navigator { display: none; }

/* ═══════════════ 3 · Drawer · vista rápida de identidad ═══════════════ */
@keyframes hpx-drawer-in { from { opacity: 0; translate: 28px 0; } to { opacity: 1; translate: 0 0; } }
@keyframes hpx-rise { from { opacity: 0; translate: 0 10px; } to { opacity: 1; translate: 0 0; } }
html body .person-drawer.ht-person-drawer.hpx-drawer {
  --hd-text: var(--hpx-ivory); --hd-muted: var(--hpx-mute);
  position: fixed !important; top: 14px !important; bottom: 14px !important; right: 14px !important; left: auto !important;
  width: min(436px, calc(100vw - 28px)) !important; max-width: none !important; height: auto !important; max-height: none !important; transform: none !important;
  display: flex !important; flex-direction: column !important; overflow: hidden !important; padding: 0 !important;
  border: 0 !important; border-radius: 30px !important;
  background: radial-gradient(120% 60% at 20% 0%, rgba(217, 192, 138, .10), transparent 60%), linear-gradient(180deg, #0c111a 0%, #070a10 100%) !important;
  box-shadow: 0 0 0 1px rgba(217, 192, 138, .13), 0 40px 110px rgba(0, 0, 0, .72), 0 0 60px rgba(217, 192, 138, .05) !important;
  animation: hpx-drawer-in .5s var(--hpx-ease) both;
}
html body .person-drawer.ht-person-drawer.hpx-drawer[data-hpx-state="memorial"] {
  background: radial-gradient(120% 60% at 20% 0%, rgba(255, 244, 214, .12), transparent 60%), linear-gradient(180deg, #0d121b 0%, #070a10 100%) !important;
}
html body .person-drawer.ht-person-drawer.hpx-drawer .hpx-hero {
  position: relative !important; top: auto !important; z-index: 1 !important; display: flex !important; flex-direction: column !important; align-items: flex-start !important; gap: 18px !important;
  margin: 0 !important; padding: 34px 30px 4px !important; border: 0 !important; background: none !important; box-shadow: none !important; overflow: visible !important;
}
.hpx-drawer .hpx-hero-glow { position: absolute; inset: -60px -40px auto -40px; height: 280px; z-index: -1; pointer-events: none; background: radial-gradient(ellipse closest-side at 26% 46%, rgba(217, 192, 138, .17), transparent); }
.hpx-drawer .hpx-hero[data-hpx-state="memorial"] .hpx-hero-glow { background: radial-gradient(ellipse closest-side at 26% 46%, rgba(255, 244, 214, .21), transparent); }
html body .person-drawer.ht-person-drawer.hpx-drawer .hpx-hero .ht-drawer-close {
  position: absolute !important; top: 18px !important; right: 18px !important; z-index: 3; display: grid !important; place-items: center !important;
  width: 42px !important; height: 42px !important; margin: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 50% !important; font-size: 18px !important;
  color: var(--hpx-ivory-dim) !important; background: rgba(255, 255, 255, .07) !important; cursor: pointer; transition: background-color .25s, color .25s;
}
.hpx-drawer .hpx-hero .ht-drawer-close:hover { background: rgba(255, 255, 255, .13) !important; color: var(--hpx-ivory) !important; }
.hpx-drawer .hpx-hero .ht-drawer-close:focus-visible { outline: 2px solid var(--hpx-champagne-hi) !important; outline-offset: 2px !important; }
html body .person-drawer.ht-person-drawer.hpx-drawer .hpx-hero-copy { display: flex !important; flex-direction: column !important; align-items: flex-start !important; gap: 7px !important; width: 100%; min-width: 0; }
html body .person-drawer.ht-person-drawer.hpx-drawer .hpx-name {
  max-width: 100% !important; margin: 0 !important; font: 600 clamp(27px, 2.3vw, 32px)/1.1 var(--hpx-serif) !important; letter-spacing: -.015em !important; color: var(--hpx-ivory) !important; outline: none; overflow-wrap: anywhere;
}
html body .person-drawer.ht-person-drawer.hpx-drawer .hpx-hid {
  padding: 0 !important; border: 0 !important; background: none !important; box-shadow: none !important; font: 700 10.5px/1 var(--hpx-sans) !important; letter-spacing: .18em !important; text-transform: uppercase; color: var(--hpx-champagne) !important;
}
.hpx-relline { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin: 2px 0 0; }
html body .person-drawer.ht-person-drawer.hpx-drawer .hpx-rel { font: 600 14px/1.3 var(--hpx-sans) !important; color: var(--hpx-champagne-hi) !important; }
.hpx-place { font-size: 14px; color: var(--hpx-ivory-dim); }
.hpx-dot { color: var(--hpx-mute); }
html body .person-drawer.ht-person-drawer.hpx-drawer .hpx-life { font: 500 13px/1.4 var(--hpx-sans) !important; color: var(--hpx-mute) !important; font-variant-numeric: tabular-nums; }
html body .person-drawer.ht-person-drawer.hpx-drawer .hpx-memorial {
  display: inline-flex !important; align-items: center; gap: 9px; margin: 4px 0 0 !important; padding: 0 !important; border: 0 !important; background: none !important; font-size: 13px !important; line-height: 1.4; color: #f6eed8 !important;
}
.hpx-memorial .hpx-ico { color: #fff3d0; filter: drop-shadow(0 0 6px rgba(255, 238, 200, .7)); }
.hpx-bio { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; margin: 6px 0 0; font-size: 14.5px; line-height: 1.6; color: var(--hpx-ivory-dim); }

html body .person-drawer.ht-person-drawer.hpx-drawer .ht-drawer-body { padding: 14px 30px 40px !important; overflow-y: auto !important; overscroll-behavior: contain; }
.hpx-drawer .hpx-quick { display: grid; gap: 34px; }
.hpx-drawer .hpx-slot:empty { display: none; }
.hpx-drawer .hpx-slot { animation: hpx-rise .6s var(--hpx-ease) both; }
.hpx-drawer .hpx-slot--actions { animation-delay: .05s; }
.hpx-drawer .hpx-slot--metrics { animation-delay: .1s; }
.hpx-drawer .hpx-slot--photos { animation-delay: .15s; }
.hpx-drawer .hpx-slot--facts { animation-delay: .2s; }
.hpx-actions-main { display: grid; gap: 10px; }
.hpx-actions-main > .hpx-btn, .hpx-actions-main .hpx-message > .hpx-btn, .hpx-actions-main .hpx-connect > .hpx-btn { width: 100%; }
.hpx-actions-quiet { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.hpx-actions-main:empty { display: none; }
.hpx-actions-main:empty + .hpx-actions-quiet { margin-top: 0; }
.hpx-slot--cta .hpx-btn--link { width: 100%; justify-content: space-between; padding: 6px 0; border-top: 1px solid var(--hpx-line); border-radius: 0; min-height: 54px; }

/* «Gestionar esta persona»: la edición heredada, sin competir con la identidad */
.hpx-manage { margin-top: 28px; border-top: 1px solid var(--hpx-line); }
.hpx-manage-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 54px; padding: 0; list-style: none; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--hpx-mute); transition: color .25s; }
.hpx-manage-summary::-webkit-details-marker { display: none; }
.hpx-manage-summary:hover { color: var(--hpx-ivory-dim); }
.hpx-manage-summary .hpx-ico { transition: transform .35s var(--hpx-ease); }
.hpx-manage[open] .hpx-manage-summary .hpx-ico { transform: rotate(180deg); }
.hpx-manage[hidden] { display: none; }
.hpx-manage-inner { padding: 4px 0 8px; }

/* En escritorio y tableta el drawer NO es modal: el árbol sigue visible y se puede tocar otra persona sin cerrar.
   (La capa móvil, hoja inferior, conserva su fondo atenuado.) */
@media (min-width: 681px) {
  html body.humanity-sheet-open .humanity-sheet-backdrop.open,
  html body:has(.person-drawer.hpx-drawer) .humanity-sheet-backdrop.open,
  html body:has(.person-drawer.hpx-drawer) .person-drawer-backdrop { background: transparent !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; pointer-events: none !important; }
}
.hpx-drawer.hpx-drawer--swap, .hpx-drawer.hpx-drawer--swap .hpx-slot { animation: none !important; }

/* ═══════════════ 4 · Perfil completo ═══════════════ */
.account-view.hpx-profile-view { padding: 0 !important; background: none !important; box-shadow: none !important; border: 0 !important; }
.hpx-profile { max-width: 1020px; margin: 0 auto; padding: 22px clamp(18px, 4vw, 48px) 80px; animation: hpx-rise .6s var(--hpx-ease) both; }
.hpx-crumbs { margin: 0 0 8px; }
.hpx-back {
  appearance: none; display: inline-flex; align-items: center; gap: 10px; min-height: 44px; margin: 0 0 0 -6px; padding: 0 14px 0 8px; border: 0; border-radius: 999px; background: transparent; font: 600 13px/1 var(--hpx-sans); color: var(--hpx-ivory-dim); cursor: pointer; transition: background-color .25s, color .25s;
}
.hpx-back:hover { background: rgba(255, 255, 255, .06); color: var(--hpx-ivory); }
.hpx-cover {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "portrait copy" "portrait actions"; column-gap: clamp(22px, 4vw, 44px); row-gap: 22px; align-items: center; padding: clamp(6px, 2vw, 18px) 0 22px;
}
.hpx-cover > .hpx-portrait { grid-area: portrait; align-self: start; }
.hpx-cover-copy { grid-area: copy; display: grid; gap: 9px; min-width: 0; }
.hpx-cover-actions { grid-area: actions; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px; }
.hpx-cover-actions .hpx-message, .hpx-cover-actions .hpx-connect { display: grid; gap: 4px; }
.hpx-cover-actions .hpx-status { max-width: 300px; margin-top: 4px; }
.hpx-cover-glow { position: absolute; inset: -60px -12% auto -12%; height: 380px; z-index: -1; pointer-events: none; background: radial-gradient(ellipse closest-side at 30% 48%, rgba(217, 192, 138, .14), transparent); }
.hpx-cover[data-hpx-state="memorial"] .hpx-cover-glow { background: radial-gradient(ellipse closest-side at 30% 48%, rgba(255, 244, 214, .19), transparent); }
.hpx-brand { margin: 0; font: 700 10px/1 var(--hpx-sans); letter-spacing: .24em; text-transform: uppercase; color: var(--hpx-champagne); }
.hpx-cover .hpx-name { margin: 0; font: 600 clamp(34px, 5vw, 54px)/1.04 var(--hpx-serif); letter-spacing: -.02em; color: var(--hpx-ivory); outline: none; overflow-wrap: anywhere; }
.hpx-cover .hpx-hid { margin: 0; font: 700 11px/1 var(--hpx-sans); letter-spacing: .18em; text-transform: uppercase; color: var(--hpx-champagne); }
.hpx-cover .hpx-rel { font-size: 15px; font-weight: 600; color: var(--hpx-champagne-hi); }
.hpx-cover .hpx-place { font-size: 15px; }
.hpx-cover .hpx-life { margin: 0; font-size: 14px; color: var(--hpx-mute); font-variant-numeric: tabular-nums; }
.hpx-cover .hpx-memorial { display: inline-flex; align-items: center; gap: 9px; margin: 2px 0 0; font-size: 14px; color: #f6eed8; }
.hpx-cover .hpx-bio { -webkit-line-clamp: 5; max-width: 62ch; font-size: 16px; line-height: 1.65; }
.hpx-profile > .hpx-state { margin: 4px 0 26px; }
.hpx-metrics--profile { margin: 0 0 8px; padding: 22px 0; gap: 18px clamp(30px, 6vw, 68px); border-block: 1px solid var(--hpx-line); }
.hpx-metrics--profile .hpx-metric-num { font-size: 36px; }

.hpx-tabs { position: sticky; top: 0; z-index: 6; display: flex; gap: clamp(20px, 4vw, 38px); margin: 0 0 30px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--hpx-line); background: rgba(7, 10, 16, .88); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.hpx-tabs::-webkit-scrollbar { display: none; }
.hpx-tab { appearance: none; position: relative; flex: none; margin: 0; padding: 17px 2px; border: 0; background: none; font: 600 13.5px/1 var(--hpx-sans); letter-spacing: .01em; color: var(--hpx-mute); cursor: pointer; transition: color .25s; }
.hpx-tab:hover { color: var(--hpx-ivory-dim); }
.hpx-tab[aria-selected="true"] { color: var(--hpx-ivory); }
.hpx-tab::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--hpx-champagne); transform: scaleX(0); transform-origin: left; transition: transform .4s var(--hpx-ease); }
.hpx-tab[aria-selected="true"]::after { transform: scaleX(1); }
.hpx-tabs-loading { align-self: center; flex: none; font-size: 12px; font-style: italic; color: var(--hpx-mute); }
.hpx-panel { outline: none; animation: hpx-rise .5s var(--hpx-ease) both; }
html body .hpx-panel .hpx-eyebrow { margin-bottom: 20px !important; }
.hpx-panel .hpx-photo-grid { gap: 6px; }
.hpx-panel .hpx-fact { grid-template-columns: 160px minmax(0, 1fr); padding: 18px 0; }
.hpx-panel .hpx-fact-value { font-size: 16px; }
.hpx-panel .hpx-fam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.hpx-panel .hpx-famgroup { margin-bottom: 30px; }
.hpx-panel .hpx-famgroup-title { font-size: 11px; letter-spacing: .15em; text-transform: uppercase; color: var(--hpx-mute); }
.hpx-subhead { margin: 34px 0 16px; font: 700 10px/1 var(--hpx-sans); letter-spacing: .18em; text-transform: uppercase; color: var(--hpx-mute); }
.hpx-quote { margin: 0 0 28px; padding: 0; }
.hpx-quote-text { margin: 0; font: 400 clamp(19px, 2.4vw, 25px)/1.55 var(--hpx-serif); color: var(--hpx-ivory); white-space: pre-line; max-width: 40ch; }
.hpx-quote-by { margin-top: 12px; font: 700 10px/1 var(--hpx-sans); letter-spacing: .16em; text-transform: uppercase; color: var(--hpx-champagne); }
.hpx-place-row { display: flex; align-items: center; gap: 14px; padding: 16px 0; border-top: 1px solid var(--hpx-line); }
.hpx-place-row > .hpx-ico { font-size: 20px; color: var(--hpx-champagne); }
.hpx-place-copy { display: grid; gap: 3px; flex: 1; min-width: 0; }
.hpx-place-name { font-size: 16px; color: var(--hpx-ivory); }
.hpx-place-precision { font-size: 12.5px; color: var(--hpx-mute); }
.hpx-placegroup { margin-bottom: 26px; }
.hpx-timeline { position: relative; margin: 0; padding: 0; list-style: none; }
.hpx-timeline::before { content: ""; position: absolute; left: 148px; top: 8px; bottom: 8px; width: 1px; background: linear-gradient(180deg, transparent, rgba(217, 192, 138, .3) 8%, rgba(217, 192, 138, .3) 92%, transparent); }
.hpx-tl { position: relative; display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 32px; padding: 14px 0 22px; }
.hpx-tl::after { content: ""; position: absolute; left: 144px; top: 19px; width: 9px; height: 9px; border-radius: 50%; background: var(--hpx-champagne); box-shadow: 0 0 0 4px #070a10, 0 0 16px rgba(217, 192, 138, .5); }
.hpx-tl--death::after { background: #fff3d0; box-shadow: 0 0 0 4px #070a10, 0 0 22px rgba(255, 238, 200, .8); }
.hpx-tl-date { font: 600 13px/1.4 var(--hpx-sans); color: var(--hpx-champagne-hi); text-align: right; font-variant-numeric: tabular-nums; }
.hpx-tl-body { display: grid; gap: 4px; justify-items: start; min-width: 0; }
.hpx-tl-title { font: 600 17px/1.3 var(--hpx-serif); color: var(--hpx-ivory); }
.hpx-tl-sub { font-size: 13.5px; color: var(--hpx-mute); }

/* ═══════════════ 5 · Visor de fotografías ═══════════════ */
.hpx-viewer { position: fixed; inset: 0; z-index: 10090; display: grid; grid-template-columns: 72px minmax(0, 1fr) 72px; align-items: center; background: rgba(3, 5, 9, .95); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); animation: hpx-fade .35s var(--hpx-ease) both; }
@keyframes hpx-fade { from { opacity: 0; } to { opacity: 1; } }
.hpx-viewer-stage { grid-column: 2; display: grid; gap: 18px; justify-items: center; margin: 0; padding: 56px 0 64px; min-width: 0; }
.hpx-viewer-frame { position: relative; display: grid; place-items: center; min-width: 200px; min-height: 200px; }
.hpx-viewer-img { display: block; max-width: min(100%, 1100px); max-height: 72vh; border-radius: 12px; object-fit: contain; box-shadow: 0 30px 90px rgba(0, 0, 0, .6); opacity: 1; transition: opacity .4s; }
.hpx-viewer-img:not([src]) { visibility: hidden; }
.hpx-viewer-frame.is-loading::after { content: ""; position: absolute; inset: 0; border-radius: 12px; background: linear-gradient(100deg, rgba(255, 255, 255, .03) 30%, rgba(255, 255, 255, .09) 50%, rgba(255, 255, 255, .03) 70%) 0 0 / 220% 100%; animation: hpx-shimmer 1.6s linear infinite; }
.hpx-viewer-fail { position: absolute; display: grid; gap: 12px; justify-items: center; color: var(--hpx-ivory-dim); text-align: center; }
.hpx-viewer-fail[hidden] { display: none; }
.hpx-viewer-caption { display: grid; gap: 5px; max-width: 62ch; text-align: center; }
.hpx-viewer-title { font: 600 18px/1.3 var(--hpx-serif); color: var(--hpx-ivory); }
.hpx-viewer-text { font-size: 14.5px; line-height: 1.55; color: var(--hpx-ivory-dim); }
.hpx-viewer-meta { font-size: 12px; color: var(--hpx-mute); }
.hpx-viewer-close, .hpx-viewer-nav { appearance: none; display: grid; place-items: center; width: 48px; height: 48px; margin: 0; padding: 0; border: 0; border-radius: 50%; color: var(--hpx-ivory); background: rgba(255, 255, 255, .08); cursor: pointer; font-size: 20px; transition: background-color .25s, transform .25s var(--hpx-ease); }
.hpx-viewer-close:hover, .hpx-viewer-nav:hover { background: rgba(255, 255, 255, .16); }
.hpx-viewer-close { position: absolute; top: 18px; right: 18px; z-index: 2; }
.hpx-viewer-prev { grid-column: 1; grid-row: 1; justify-self: center; }
.hpx-viewer-next { grid-column: 3; grid-row: 1; justify-self: center; }
.hpx-viewer-nav[hidden] { display: none; }
.hpx-viewer-counter { position: absolute; left: 0; right: 0; bottom: 20px; margin: 0; text-align: center; font: 600 12px/1 var(--hpx-sans); letter-spacing: .16em; color: var(--hpx-mute); font-variant-numeric: tabular-nums; }

/* ═══════════════ 6 · Mensajes: la conversación se identifica por la persona ═══════════════ */
.humanity-conversation-button strong { display: block; font-weight: 600; }
.humanity-conversation-button small { display: block; margin-top: 2px; font-size: .78em; opacity: .7; }
.humanity-chat-who { display: grid; gap: 2px; min-width: 0; }
.humanity-chat-who small { font-size: .78em; opacity: .7; }

/* ═══════════════ 7 · Tablet y móvil ═══════════════ */
@media (min-width: 681px) and (max-width: 980px) {
  html body .person-drawer.ht-person-drawer.hpx-drawer { width: min(400px, calc(100vw - 28px)) !important; }
  html body .person-drawer.ht-person-drawer.hpx-drawer .hpx-hero { padding: 30px 24px 2px !important; }
  html body .person-drawer.ht-person-drawer.hpx-drawer .ht-drawer-body { padding-inline: 24px !important; }
}
@media (max-width: 760px) {
  .hpx-navigator {
    display: block; margin: 0 0 12px; padding: 14px 16px 12px; border-radius: 22px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .015));
  }
  .hpx-nav-focus { display: grid; gap: 4px; margin: 0 0 10px; }
  .hpx-nav-kicker { font: 700 9.5px/1 var(--hpx-sans); letter-spacing: .18em; text-transform: uppercase; color: var(--hpx-champagne); }
  .hpx-nav-name { font: 600 21px/1.15 var(--hpx-serif); color: var(--hpx-ivory); }
  .hpx-nav-rail { display: flex; gap: 20px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; scroll-snap-type: x proximity; }
  .hpx-nav-rail::-webkit-scrollbar { display: none; }
  .hpx-nav-group { display: grid; gap: 8px; flex: none; scroll-snap-align: start; }
  .hpx-nav-label { font: 700 9.5px/1 var(--hpx-sans); letter-spacing: .16em; text-transform: uppercase; color: var(--hpx-mute); }
  .hpx-nav-chips { display: flex; gap: 8px; }
  .hpx-navigator .hpx-btn--quiet { flex: none; align-self: end; }
}
@media (max-width: 680px) {
  html body .person-drawer.ht-person-drawer.hpx-drawer {
    top: auto !important; bottom: 0 !important; left: 0 !important; right: 0 !important; inset-inline: 0 !important; width: 100% !important; height: min(90dvh, 100% - 40px) !important;
    border-radius: 28px 28px 0 0 !important; animation: hpx-sheet-in .5s var(--hpx-ease) both;
  }
  html body .person-drawer.ht-person-drawer.hpx-drawer::before { display: none !important; }
  html body .person-drawer.ht-person-drawer.hpx-drawer .hpx-hero { padding: 28px 22px 2px !important; flex-direction: row !important; flex-wrap: wrap; align-items: flex-end !important; gap: 14px 16px !important; }
  .hpx-drawer .hpx-hero > .hpx-portrait { --hpx-size: 76px; }
  html body .person-drawer.ht-person-drawer.hpx-drawer .hpx-hero-copy { flex: 1 1 100%; }
  html body .person-drawer.ht-person-drawer.hpx-drawer .ht-drawer-body { padding: 12px 22px calc(34px + env(safe-area-inset-bottom)) !important; }
  html body .person-drawer.ht-person-drawer.hpx-drawer .hpx-hero .ht-drawer-close { top: 14px !important; right: 14px !important; }
  .hpx-drawer .hpx-hero::before { content: ""; position: absolute; top: 9px; left: 50%; width: 42px; height: 4px; margin-left: -21px; border-radius: 4px; background: rgba(255, 255, 255, .22); }
  .hpx-btn { min-height: 48px; }
  .hpx-btn--quiet { min-height: 44px; }
  .hpx-profile { padding: 8px 16px 72px; }
  .hpx-cover { grid-template-columns: 1fr; grid-template-areas: "portrait" "copy" "actions"; row-gap: 18px; justify-items: center; text-align: center; padding-top: 0; }
  .hpx-cover > .hpx-portrait { --hpx-size: 112px; align-self: center; justify-self: center; }
  .hpx-cover-copy { justify-items: center; width: 100%; }
  .hpx-cover .hpx-brand { display: none; }
  .hpx-cover .hpx-name { font-size: clamp(30px, 9vw, 38px); }
  .hpx-cover .hpx-bio { font-size: 15px; text-align: center; }
  .hpx-cover .hpx-memorial { display: inline-flex; align-items: flex-start; justify-content: center; gap: 9px; max-width: 30ch; text-align: left; }
  .hpx-cover .hpx-memorial .hpx-ico { margin-top: 3px; flex: none; }
  .hpx-cover-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; gap: 10px; }
  .hpx-cover-actions > :first-child:nth-last-child(odd), .hpx-cover-actions > .hpx-message, .hpx-cover-actions > .hpx-connect { grid-column: 1 / -1; }
  .hpx-cover-actions .hpx-btn { width: 100%; white-space: nowrap; padding-inline: 12px; font-size: 14px; }
  .hpx-cover-actions .hpx-status { max-width: none; text-align: center; }
  .hpx-profile > .hpx-state { justify-content: center; text-align: center; }
  .hpx-metrics--profile { justify-content: space-around; gap: 10px; padding: 18px 0; }
  .hpx-metrics--profile .hpx-metric { justify-items: center; text-align: center; }
  .hpx-metrics--profile .hpx-metric-num { font-size: 28px; }
  .hpx-tabs { margin-inline: -16px; padding-inline: 16px; }
  .hpx-thumbs, .hpx-photo-grid { gap: 3px; }
  .hpx-panel .hpx-photo-grid .hpx-thumb { border-radius: 6px; }
  .hpx-panel .hpx-fact { grid-template-columns: 1fr; gap: 4px; padding: 15px 0; }
  .hpx-panel .hpx-fam-grid { grid-template-columns: 1fr; }
  .hpx-timeline::before { left: 5px; }
  .hpx-tl { grid-template-columns: 1fr; gap: 4px; padding: 10px 0 20px 30px; }
  .hpx-tl::after { left: 1px; top: 15px; }
  .hpx-tl-date { text-align: left; }
  .hpx-viewer { grid-template-columns: 1fr; }
  .hpx-viewer-stage { grid-column: 1; padding: 64px 14px 70px; }
  .hpx-viewer-img { max-height: 64vh; border-radius: 6px; }
  .hpx-viewer-nav { position: absolute; top: 50%; margin-top: -24px; background: rgba(5, 7, 11, .55); }
  .hpx-viewer-prev { left: 10px; }
  .hpx-viewer-next { right: 10px; }
}
@keyframes hpx-sheet-in { from { opacity: 0; translate: 0 40px; } to { opacity: 1; translate: 0 0; } }

/* ═══════════════ 8 · Movimiento reducido ═══════════════ */
@media (prefers-reduced-motion: reduce) {
  .hpx-drawer, .hpx-drawer .hpx-slot, .hpx-profile, .hpx-panel, .hpx-viewer { animation: none !important; }
  .hpx-btn, .hpx-chip, .hpx-thumb, .hpx-thumb-img, .hpx-memory, .hpx-tab, .hpx-tab::after, .hpx-back, .hpx-link, .hpx-portrait-img,
  #HumanidadFamilyChart .card .humanidad-f3-card.hpx-card, .humanidad-f3-stage .card { transition: none !important; }
  .hpx-btn:hover, .hpx-chip:hover, .hpx-thumb:hover, .hpx-memory:hover { transform: none !important; }
  .hpx-skel, .hpx-thumb.is-loading::after, .hpx-viewer-frame.is-loading::after { animation: none !important; }
}

/* ═══════════════ 9 · Luz de memoria (marfil, no violeta) ═══════════════ */
html body .account-view[data-view="tree"] .f3-state-legend i.memorial { background: #f6ecd0 !important; box-shadow: 0 0 8px rgba(255, 240, 205, .75) !important; }
html body #HumanidadFamilyChart .card .ht-memory-light { color: #fff1cf !important; text-shadow: 0 0 8px rgba(255, 238, 200, .85) !important; filter: none !important; }


/* ═══════════════ 10 · Post-Excellence · gestión secundaria sin fuga visual ═══════════════
 * La ficha heredada vive solo dentro de «Gestionar esta persona». Incluso si otra capa
 * global toca <details> o botones, el editor nunca vuelve a competir con el perfil vivo.
 */
.hpx-drawer .hpx-manage:not([open]) > .hpx-manage-inner { display: none !important; }
.hpx-drawer .hpx-manage[open] > .hpx-manage-inner { display: block !important; }
.hpx-drawer .hpx-manage-inner .ht-edit-grid { display: grid !important; grid-template-columns: 1fr !important; gap: 14px !important; }
.hpx-drawer .hpx-manage-inner :is(.family-field-wrap,.ht-span-full) { min-width: 0 !important; width: 100% !important; }
.hpx-drawer .hpx-manage-inner .family-field-label { display: block !important; margin: 0 0 7px !important; font: 700 9px/1.2 var(--hpx-sans) !important; letter-spacing: .14em !important; text-transform: uppercase !important; color: var(--hpx-mute) !important; }
.hpx-drawer .hpx-manage-inner :is(input.account-field,textarea.account-field,select.account-field) {
  width: 100% !important; min-width: 0 !important; min-height: 44px !important; box-sizing: border-box !important;
  border: 1px solid var(--hpx-line) !important; border-radius: 12px !important; outline: none !important;
  background: rgba(255,255,255,.035) !important; color: var(--hpx-ivory) !important; box-shadow: none !important;
  font: 500 13px/1.45 var(--hpx-sans) !important; color-scheme: dark;
}
.hpx-drawer .hpx-manage-inner textarea.account-field { min-height: 92px !important; resize: vertical !important; padding: 12px !important; }
.hpx-drawer .hpx-manage-inner :is(input.account-field,select.account-field) { padding: 0 12px !important; }
.hpx-drawer .hpx-manage-inner :is(input.account-field,textarea.account-field,select.account-field):focus { border-color: var(--hpx-champagne-line) !important; box-shadow: 0 0 0 3px rgba(217,192,138,.06) !important; }
.hpx-drawer .hpx-manage-inner .humanidad-custom-combobox { min-width: 0 !important; width: 100% !important; }
.hpx-drawer .hpx-manage-inner .humanidad-combobox-trigger {
  appearance: none !important; -webkit-appearance: none !important; width: 100% !important; min-width: 0 !important;
  min-height: 52px !important; height: auto !important; max-height: none !important; padding: 8px 10px !important;
  display: grid !important; grid-template-columns: 34px minmax(0,1fr) 16px !important; align-items: center !important; gap: 10px !important;
  border: 1px solid var(--hpx-line) !important; border-radius: 12px !important; background: rgba(255,255,255,.035) !important;
  color: var(--hpx-ivory) !important; box-shadow: none !important; text-align: left !important; overflow: hidden !important;
}
.hpx-drawer .hpx-manage-inner .humanidad-combobox-trigger:hover { border-color: var(--hpx-champagne-line) !important; background: rgba(217,192,138,.055) !important; }
.hpx-drawer .hpx-manage-inner .combobox-trigger-avatar {
  width: 34px !important; height: 34px !important; display: grid !important; place-items: center !important; overflow: hidden !important;
  border-radius: 50% !important; background: linear-gradient(160deg,#1a2231,#0b0f17) !important; color: var(--hpx-champagne-hi) !important;
  box-shadow: inset 0 0 0 1px rgba(217,192,138,.2) !important; font: 600 12px/1 var(--hpx-serif) !important;
}
.hpx-drawer .hpx-manage-inner .combobox-trigger-info { min-width: 0 !important; display: grid !important; gap: 3px !important; }
.hpx-drawer .hpx-manage-inner .combobox-trigger-name { min-width: 0 !important; overflow: hidden !important; text-overflow: ellipsis !important; white-space: nowrap !important; font: 600 12px/1.25 var(--hpx-sans) !important; color: var(--hpx-ivory) !important; }
.hpx-drawer .hpx-manage-inner .combobox-trigger-role { min-width: 0 !important; overflow: hidden !important; text-overflow: ellipsis !important; white-space: nowrap !important; font: 500 10px/1.25 var(--hpx-sans) !important; color: var(--hpx-mute) !important; }
.hpx-drawer .hpx-manage-inner .combobox-trigger-chevron { width: 16px !important; height: 16px !important; display: block !important; color: var(--hpx-mute) !important; transform: none !important; }
.hpx-drawer .humanidad-combobox-popover {
  max-height: min(320px,50vh) !important; overflow: hidden !important; border: 1px solid var(--hpx-line) !important; border-radius: 14px !important;
  background: #0c1119 !important; color: var(--hpx-ivory) !important; box-shadow: 0 24px 64px rgba(0,0,0,.58) !important;
}
.hpx-drawer .humanidad-combobox-popover .combobox-search-wrap { padding: 10px !important; border-bottom: 1px solid var(--hpx-line) !important; background: #0c1119 !important; }
.hpx-drawer .humanidad-combobox-popover .combobox-search-input { width: 100% !important; min-height: 40px !important; border: 1px solid var(--hpx-line) !important; border-radius: 10px !important; background: rgba(255,255,255,.035) !important; color: var(--hpx-ivory) !important; }
.hpx-drawer .humanidad-combobox-popover .combobox-options-list { max-height: 250px !important; overflow-y: auto !important; margin: 0 !important; padding: 6px !important; background: #0c1119 !important; }
.hpx-drawer .humanidad-combobox-popover .combobox-option { min-height: 46px !important; display: grid !important; grid-template-columns: 30px minmax(0,1fr) auto !important; align-items: center !important; gap: 9px !important; padding: 7px 9px !important; border-radius: 9px !important; color: var(--hpx-ivory-dim) !important; }
.hpx-drawer .humanidad-combobox-popover .combobox-option:is(:hover,.is-focused,.selected) { background: rgba(217,192,138,.08) !important; color: var(--hpx-ivory) !important; }
