/* Arbore referințe porumbei — stiluri proprii peste Bootstrap 5 */
:root{
  --bg:#eef1f4; --surface:#ffffff; --ink:#13263a; --muted:#5a6b7c; --line:#7f909f;
  --rule:#d5dce3; --root:#14324f; --gold:#f4c247; --gold-ink:#3b2b00;
  --f-display:"IBM Plex Sans Condensed","Arial Narrow",system-ui,sans-serif;
  --f-body:"IBM Plex Sans",system-ui,-apple-system,"Segoe UI",sans-serif;
  --f-mono:"IBM Plex Mono",ui-monospace,Consolas,monospace;
  --bs-body-font-family:var(--f-body);
}
html,body{height:100%}
body{background:var(--bg);color:var(--ink);font-family:var(--f-body);font-size:14px}
.mono{font-family:var(--f-mono)}

/* bara de sus */
.top{background:var(--surface);border-bottom:1px solid var(--rule);padding:14px 16px 12px;display:flex;flex-direction:column;gap:10px}
.top-row{display:flex;flex-wrap:wrap;align-items:flex-start;gap:12px 20px;justify-content:space-between}
.ttl{min-width:0}
.ttl h1{margin:0;color:var(--ink);font-family:var(--f-display);font-weight:700;font-size:1.6rem;line-height:1.15;text-wrap:balance}
.ttl p{margin:4px 0 0;color:var(--muted);font-size:.86rem;max-width:75ch}
.mode-pill{font-family:var(--f-display);font-weight:600;font-size:.74rem;letter-spacing:.08em;text-transform:uppercase;padding:4px 9px;border-radius:99px;border:1px solid var(--rule);color:var(--muted)}
body.editing .mode-pill{background:var(--gold);color:var(--gold-ink);border-color:var(--gold)}
.fam-tabs{gap:4px}
.fam-tabs .nav-link{padding:4px 11px;font-size:.84rem;color:var(--muted);border:1px solid var(--rule)}
.fam-tabs .nav-link.active{background:var(--ink);border-color:var(--ink);color:#fff}
.legend{display:flex;flex-wrap:wrap;gap:6px 16px;font-size:.8rem;color:var(--muted);align-items:center}
.legend span{display:inline-flex;align-items:center;gap:6px}
.sw{width:13px;height:13px;border-radius:3px;display:inline-block}
.sw.split{background:linear-gradient(105deg,#1f7a5a 0 55%,#2c6cb0 55%)}
.badge-demo{background:var(--gold);color:var(--gold-ink);font-weight:600;border-radius:3px;padding:0 5px;font-size:.75rem;font-style:normal}
.circ{width:11px;height:11px;border-radius:50%;border:2px solid var(--line);background:var(--surface);display:inline-block}
.editbar{display:none;background:var(--gold);color:var(--gold-ink);padding:8px 16px;font-size:.85rem;align-items:center;gap:8px 10px;flex-wrap:wrap}
body.editing .editbar{display:flex}
.editbar > b{font-family:var(--f-display);letter-spacing:.04em}
body.editing #btnLogin{display:none}

/* pânza arborelui */
.viewport{flex:1;overflow:auto;min-height:0;position:relative}
.canvas{position:relative}
.stage{position:absolute;left:0;top:0;transform-origin:0 0}
.stage svg{position:absolute;left:0;top:0;overflow:visible}
.stage path{fill:none;stroke:var(--line);stroke-width:1.6}
.stage path.sec,.stage path.pri{stroke-width:2.2}
.stage circle.gp{fill:var(--surface);stroke-width:2.2}
.stage text.gpl{font:italic 11px var(--f-body);fill:var(--muted)}
.stage text.halo{paint-order:stroke;stroke:var(--bg);stroke-width:4px;stroke-linejoin:round}
.empty-tree{position:absolute;inset:40px 16px auto;max-width:420px;margin:0 auto;background:var(--surface);border:1px dashed var(--line);border-radius:8px;padding:18px;text-align:center;color:var(--muted)}

.card-p{position:absolute;width:236px;background:color-mix(in srgb,var(--c) 8%,var(--surface));border:1.5px solid var(--c);border-radius:7px;box-shadow:0 1px 2px rgba(10,30,50,.08)}
.card-p .hd{background:var(--c);color:#fff;padding:7px 10px 6px;border-radius:5px 5px 0 0;position:relative}
.card-p .nm{font-family:var(--f-display);font-weight:700;font-size:1.02rem;letter-spacing:.03em;text-transform:uppercase;padding-right:22px;line-height:1.2}
.card-p .sr{font-family:var(--f-mono);font-size:.72rem;opacity:.9;margin-top:2px;display:flex;gap:8px;align-items:center}
.card-p .bd{padding:7px 10px 9px;font-size:.8rem;line-height:1.42;display:flex;flex-direction:column;gap:1px}
.card-p .bd .note{font-style:italic;color:var(--muted)}
.card-p .bd b{color:color-mix(in srgb,var(--c) 80%,var(--ink));font-weight:600}
.card-p .bd .g{background:var(--gold);color:var(--gold-ink);border-radius:3px;padding:0 4px;font-weight:600}
.card-p .ml{margin-top:5px;padding-top:5px;border-top:1px dashed color-mix(in srgb,var(--c) 45%,transparent);font-size:.74rem;color:var(--muted);display:flex;gap:5px;align-items:center;flex-wrap:wrap}
.card-p .ml i{width:10px;height:10px;border-radius:2px;display:inline-block}
.card-p.root{width:320px}
.card-p.root .nm{font-size:1.3rem}
.card-p .ed,.card-p .add{display:none}
body.editing .card-p .ed{display:grid;place-items:center;position:absolute;top:6px;right:6px;width:22px;height:22px;border-radius:4px;border:0;background:rgba(255,255,255,.2);color:#fff;opacity:0;transition:opacity .15s;padding:0}
body.editing .card-p .ed svg{width:13px;height:13px}
body.editing .card-p .add{display:grid;place-items:center;position:absolute;left:50%;bottom:-13px;transform:translateX(-50%);width:24px;height:24px;border-radius:50%;border:1.5px solid var(--c);background:var(--surface);color:var(--c);font-size:16px;line-height:1;font-weight:600;opacity:0;transition:opacity .15s,transform .15s;z-index:2;padding:0}
body.editing .card-p:hover .ed,body.editing .card-p:hover .add,body.editing .card-p:focus-within .ed,body.editing .card-p:focus-within .add{opacity:1}
body.editing .card-p .add:hover{transform:translateX(-50%) scale(1.12);background:var(--c);color:#fff}
@media (hover:none){body.editing .card-p .ed,body.editing .card-p .add{opacity:.85}}
.card-p.new{animation:flash 1.6s ease-out}
@keyframes flash{0%{box-shadow:0 0 0 0 var(--gold)}30%{box-shadow:0 0 0 6px var(--gold)}100%{box-shadow:0 1px 2px rgba(10,30,50,.08)}}
@media (prefers-reduced-motion:reduce){.card-p.new{animation:none}}

/* ferestre */
.seg .btn{display:flex;flex-direction:column;align-items:center;gap:2px}
.seg .ico{height:20px;width:36px}
.seg .ico path{stroke:currentColor;stroke-width:1.6;fill:none}
.seg .ico circle{stroke:currentColor;stroke-width:1.6;fill:var(--surface)}
.seg .btn-check:checked + .btn .ico circle{fill:var(--ink)}
.inter{border:1px dashed var(--line);border-radius:7px;padding:10px}
.extra{border:1px solid var(--rule);border-radius:8px;padding:10px 12px;background:#f6f8fa}
.exlist{display:flex;flex-direction:column;gap:4px;max-height:210px;overflow:auto}
.exitem{text-align:left;border:1px solid var(--rule);background:var(--surface);color:var(--ink);border-radius:6px;padding:6px 10px}
.exitem small{display:block;color:var(--muted);font-family:var(--f-mono);font-size:.72rem}
.exitem[aria-pressed="true"]{border-color:var(--ink);box-shadow:inset 0 0 0 1px var(--ink)}
.exitem .nm2{font-family:var(--f-display);font-weight:600;text-transform:uppercase;letter-spacing:.03em}
.lk{display:flex;align-items:center;gap:8px;border:1px solid var(--rule);border-radius:6px;padding:6px 10px;font-size:.84rem}
.empty{color:var(--muted);font-size:.82rem;font-style:italic}
.modal-title{font-family:var(--f-display);font-weight:700}
