
.gpv-grid{display:grid;grid-template-columns:320px 1fr;gap:22px}.gpv-card{background:#fff;border:1px solid #ead7b8;border-radius:14px;padding:18px;box-shadow:0 8px 24px rgba(80,35,0,.05)}.gpv-card label{display:block;font-weight:700;color:#8b0016;margin:10px 0 5px}.gpv-card input,.gpv-card select,.gpv-card textarea{width:100%;max-width:100%;min-height:34px}.gpv-card textarea{height:92px}.gpv-tree-shell{border:1px solid #ead7b8;border-radius:18px;background:#fffaf2;margin:18px auto;padding:16px;max-width:1180px}.gpv-tree-head{background:#930019;color:#fff;border-radius:12px;padding:15px 18px;display:flex;justify-content:space-between;gap:12px}.gpv-tree-tools{text-align:right;margin:12px 0}.gpv-tree-tools button,.gpv-actions button{border:1px solid #d98b48;background:#fff;border-radius:18px;color:#9b0018;font-weight:700;padding:5px 12px;cursor:pointer}.gpv-tree-viewport{overflow:auto;border-radius:12px;background:#fffdf8;min-height:520px;touch-action:pan-x pan-y}.gpv-tree-canvas{position:relative;transform-origin:0 0;transition:transform .15s ease}.gpv-svg{position:absolute;left:0;top:0;z-index:1;overflow:visible}.gpv-svg path{fill:none;stroke:#c9853e;stroke-width:2.1;stroke-linecap:round;stroke-linejoin:round}.gpv-line-spouse{stroke:#a00020!important;stroke-width:2.4!important}.gpv-line-bus{stroke:#c9853e!important}.gpv-node{position:absolute;z-index:2;box-sizing:border-box;background:#fff;border:1px solid #edc99b;border-radius:13px;box-shadow:0 8px 18px rgba(90,45,0,.08);padding:14px;display:flex;gap:10px}.gpv-avatar{width:32px;height:32px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:#ffe6b5;flex:0 0 32px}.gpv-node b{display:block;color:#8b0016;font-size:15px;margin-bottom:4px}.gpv-node small{display:block;font-size:12px;color:#684b39;line-height:1.5}.gpv-node i{display:inline-block;width:8px;height:8px;border-radius:50%;background:#333}.gpv-node i.living{background:#5caf57}.gpv-actions{margin-top:7px}.gpv-actions.is-hidden{display:none}.gpv-inline-form{display:none;margin-top:8px;padding:8px;border:1px dashed #d9a76f;border-radius:10px}.gpv-inline-form.is-open{display:block}.gpv-inline-form input,.gpv-inline-form select{width:100%;margin:3px 0;height:28px}.gpv-inline-form button{background:#2b6dcc;color:#fff;border-color:#2b6dcc;border-radius:7px;width:100%;margin-top:4px}.gpv-actions-hidden .gpv-actions{display:none}@media(max-width:700px){.gpv-grid{grid-template-columns:1fr}.gpv-tree-shell{margin:8px 0;padding:10px}.gpv-tree-head{display:block}.gpv-tree-tools{text-align:left}.gpv-tree-viewport{min-height:520px}.gpv-node{font-size:12px}}


/* Tree Engine 5.4.1 Smart Family Graph */
.gpv-tree-viewport{background:linear-gradient(#fffdf8,#fffaf2); border:1px solid #f4e5cf;}
.gpv-svg path{fill:none;stroke:#8fbdf4;stroke-width:1.8;stroke-linecap:square;stroke-linejoin:miter;shape-rendering:geometricPrecision}
.gpv-line-spouse{stroke:#e83e8c!important;stroke-width:2.1!important}
.gpv-line-family-anchor,.gpv-line-family-to-bus,.gpv-line-child-drop{stroke:#8fbdf4!important;stroke-width:1.8!important}
.gpv-line-children-bus{stroke:#8fbdf4!important;stroke-width:1.8!important}
.gpv-node{border-color:#8fb6ff;background:#f7fbff;box-shadow:none}
.gpv-node:has(select),.gpv-node .female{border-color:#ff7ab6}
.gpv-node b{font-size:14px}
.gpv-tree-head span{font-weight:600;opacity:.95}


/* 5.3 Modal input: không còn form nằm trong node nên không bị che khuất */
.gpv-modal{display:none;position:fixed;inset:0;z-index:999999;align-items:center;justify-content:center}
.gpv-modal.is-open{display:flex}
.gpv-modal-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.35)}
.gpv-modal-panel{position:relative;background:#fffdf8;border:1px solid #e5c7a0;border-radius:18px;padding:20px;box-shadow:0 24px 70px rgba(0,0,0,.25);width:min(420px,92vw);z-index:2}
.gpv-modal-x{position:absolute;right:12px;top:10px;border:0;background:#fff;color:#99001b;font-size:26px;line-height:1;cursor:pointer}
.gpv-modal-panel h3{margin:0 0 6px;color:#8b0016}
.gpv-modal-help{margin:0 0 14px;color:#6d5141}
.gpv-modal-form{display:none}
.gpv-modal-form.is-active{display:block}
.gpv-modal-form label{display:block;font-weight:700;color:#8b0016;margin:10px 0 5px}
.gpv-modal-form input,.gpv-modal-form select{width:100%;height:38px;border:1px solid #d8c2aa;border-radius:8px;padding:6px 9px}
.gpv-modal-form button{margin-top:14px;width:100%;height:40px;background:#2268cc;border:0;border-radius:10px;color:#fff;font-weight:700}
.gpv-node{overflow:visible}
.gpv-actions{position:relative;z-index:4}
.gpv-svg path{vector-effect:non-scaling-stroke}
.gpv-line-family-anchor,.gpv-line-family-to-bus,.gpv-line-child-drop,.gpv-line-children-bus{stroke:#7fb5f2!important;stroke-width:1.7!important}
.gpv-line-spouse{stroke:#e83e8c!important;stroke-width:2!important}


/* 5.4 Button Fix + Stable Node Box */
.gpv-node{height:128px!important; min-height:128px; padding:13px 14px; overflow:visible!important}
.gpv-actions{display:flex;gap:5px;flex-wrap:wrap;margin-top:7px}
.gpv-actions button{font-size:12px;line-height:1.1;padding:5px 9px;background:#fffdf8;white-space:nowrap}
.gpv-tree-viewport{min-height:620px}
.gpv-svg path{pointer-events:none}
.gpv-modal{z-index:2147483000!important}
.gpv-modal-panel{max-height:86vh;overflow:auto}
.gpv-actions-hidden .gpv-actions{display:none!important}
@media(max-width:700px){
 .gpv-node{height:132px!important}
 .gpv-actions button{font-size:12px;padding:5px 8px}
 .gpv-modal-panel{width:94vw}
}


/* 5.4.1 Button + Spouse Line Hotfix */
.gpv-tree-shell{position:relative}
.gpv-node{height:136px!important;min-height:136px;overflow:visible!important}
.gpv-actions{position:relative!important;z-index:50!important;display:flex!important;gap:6px;flex-wrap:wrap}
.gpv-actions button{cursor:pointer!important;pointer-events:auto!important;position:relative;z-index:51!important}
.gpv-actions-hidden .gpv-actions{display:none!important}
.gpv-modal{position:fixed!important;inset:0!important;display:none;z-index:2147483640!important}
.gpv-modal.is-open{display:flex!important;align-items:center!important;justify-content:center!important}
.gpv-modal-backdrop{position:absolute!important;inset:0!important;background:rgba(0,0,0,.38)!important}
.gpv-modal-panel{position:relative!important;z-index:2147483641!important;background:#fffdf8!important}
.gpv-svg{pointer-events:none!important}
.gpv-line-spouse{stroke:#e4007f!important;stroke-width:2.2!important}
.gpv-line-family-anchor,.gpv-line-family-to-bus,.gpv-line-child-drop,.gpv-line-children-bus{stroke:#6fb0f7!important;stroke-width:1.8!important}


/* Tree Engine 6.0 Family Unit Graph */
.gpv-tree-head span{font-weight:700}
.gpv-node{width:220px!important;height:132px!important;min-height:132px!important;background:#f7fbff;border-color:#8eb8ff;overflow:visible!important}
.gpv-node b{font-size:14px}
.gpv-actions{display:flex!important;gap:6px;flex-wrap:wrap;position:relative;z-index:60}
.gpv-actions button{pointer-events:auto!important;cursor:pointer!important;font-size:12px;padding:5px 9px;background:#fffdf8}
.gpv-svg{pointer-events:none!important;overflow:visible}
.gpv-line{fill:none;stroke-linecap:square;stroke-linejoin:miter;vector-effect:non-scaling-stroke;shape-rendering:geometricPrecision}
.gpv-layer-spouse .gpv-line{stroke:#e4007f;stroke-width:2.2}
.gpv-layer-unit .gpv-line{stroke:#3f9cff;stroke-width:1.8}
.gpv-layer-bus .gpv-line{stroke:#6fb0f7;stroke-width:1.8}
.gpv-layer-child .gpv-line{stroke:#6fb0f7;stroke-width:1.8}
.gpv-modal{position:fixed!important;inset:0!important;z-index:2147483640!important}
.gpv-modal.is-open{display:flex!important;align-items:center!important;justify-content:center!important}
.gpv-modal-panel{z-index:2147483641!important}
.gpv-actions-hidden .gpv-actions{display:none!important}


/* Tree Engine 6.1 Graph Layout Core */
.gpv-tree-head span{font-weight:700}
.gpv-node{width:220px!important;height:132px!important;min-height:132px!important;background:#f7fbff;border-color:#8eb8ff;overflow:visible!important}
.gpv-actions{display:flex!important;gap:6px;flex-wrap:wrap;position:relative;z-index:80}
.gpv-actions button{pointer-events:auto!important;cursor:pointer!important;font-size:12px;padding:5px 9px;background:#fffdf8}
.gpv-svg{pointer-events:none!important;overflow:visible}
.gpv-line{fill:none;stroke-linecap:square;stroke-linejoin:miter;vector-effect:non-scaling-stroke;shape-rendering:geometricPrecision}
.gpv-layer-spouse .gpv-line{stroke:#e4007f;stroke-width:2.2}
.gpv-layer-unit .gpv-line{stroke:#2d96ff;stroke-width:1.8}
.gpv-layer-bus .gpv-line{stroke:#65aef6;stroke-width:1.8}
.gpv-layer-child .gpv-line{stroke:#65aef6;stroke-width:1.8}
.gpv-modal{position:fixed!important;inset:0!important;z-index:2147483640!important}
.gpv-modal.is-open{display:flex!important;align-items:center!important;justify-content:center!important}
.gpv-modal-panel{z-index:2147483641!important}
.gpv-actions-hidden .gpv-actions{display:none!important}
