/* ============================================================
   PASSAGE — Relationship map (graph.js), rebuilt 29 Sep 2026.
   Cards in lanes with measured connectors — the family tree's grammar
   (familytree.js), in the map's vocabulary. House tokens only; every new
   class is prefixed gr-.
   ============================================================ */

.gr-view{display:flex;flex-direction:column;gap:14px;min-width:0}

/* ---------- pickers ---------- */
.gr-bar{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
.gr-field{display:flex;align-items:center;gap:8px;border:1px solid var(--stroke);border-radius:var(--r-sm);padding:0 4px 0 10px;min-height:38px;background:var(--paper);flex:0 1 320px;min-width:0}
.gr-flabel{font-size:9.5px;letter-spacing:.14em;text-transform:uppercase;color:var(--ink-soft);font-weight:600;white-space:nowrap}
.gr-field select{border:0;background:transparent;font:inherit;font-size:13px;color:var(--ink);min-width:0;flex:1;height:36px;padding:0 4px}
.gr-field > *:not(.gr-flabel){flex:1;min-width:0}

/* ---------- focus header ---------- */
.gr-head{display:flex;align-items:center;gap:14px;padding:4px 0 12px;border-bottom:1px solid var(--stroke-soft)}
.gr-head-t{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.gr-head-k{font-size:10px;letter-spacing:.14em;text-transform:uppercase;color:var(--gold-deep);font-weight:600}
.gr-head h2{margin:0;font-family:var(--disp);font-weight:700;font-size:21px;line-height:1.2;color:var(--ink);overflow-wrap:anywhere}
.gr-head-s{font-size:12.5px;color:var(--ink-soft)}
.gr-backbtn{display:inline-flex;align-items:center;gap:4px;border:1px solid var(--stroke);border-radius:99px;background:var(--paper);color:var(--ink-soft);font:inherit;font-size:12.5px;font-weight:600;padding:6px 12px 6px 8px;cursor:pointer;white-space:nowrap}
.gr-backbtn:hover{color:var(--ink);background:var(--bone)}
.gr-backbtn svg{width:14px;height:14px}

/* ---------- whole-practice lenses ---------- */
.gr-lenses{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.gr-lens{display:flex;align-items:baseline;gap:10px;text-align:left;font:inherit;color:var(--ink-soft);background:rgba(255,255,255,.55);border:1px solid var(--stroke-soft);border-radius:var(--r-md);padding:12px 14px;cursor:pointer;transition:border-color .15s,background .15s}
.gr-lens:hover{border-color:rgba(169,130,76,.45)}
.gr-lens b{font-family:var(--disp);font-size:22px;font-weight:700;color:var(--ink);font-variant-numeric:tabular-nums;line-height:1}
.gr-lens span{font-size:12px;line-height:1.35}
.gr-lens em{font-style:normal;color:var(--ink-faint)}
.gr-lens.on{border-color:var(--gold);background:linear-gradient(180deg,#fffdf8,#fbf6ea);box-shadow:0 0 0 3px rgba(169,130,76,.10)}
.gr-lens.on b{color:var(--gold-deep)}
.gr-lens:focus-visible,.gr-more:focus-visible,.gr-chip:focus-visible,.gr-backbtn:focus-visible{outline:2px solid var(--gold);outline-offset:2px}

.gr-rows{display:flex;flex-direction:column;gap:12px}
.gr-note{margin:0;font-size:12.5px;color:var(--ink-soft);max-width:760px;line-height:1.5}
.gr-empty{padding:28px 16px;text-align:center;color:var(--ink-soft);font-size:13px;background:rgba(255,255,255,.45);border:1px dashed var(--stroke);border-radius:var(--r-md)}
.gr-more{align-self:center;display:inline-flex;gap:8px;align-items:baseline;border:1px solid var(--stroke);background:var(--paper);border-radius:99px;padding:8px 18px;font:inherit;font-size:13px;font-weight:600;color:var(--ink);cursor:pointer}
.gr-more:hover{background:var(--bone)}
.gr-more span{font-weight:500;font-size:11.5px;color:var(--ink-soft)}
.gr-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:10px}
.gr-grid .gr-card{width:auto}
.gr-empty-emps{border-top:1px solid var(--stroke-soft);padding-top:10px}
.gr-empty-emps summary{cursor:pointer;font-size:12.5px;color:var(--ink-soft);padding:4px 0}
.gr-chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.gr-chip{border:1px solid var(--stroke-soft);background:var(--paper);border-radius:99px;padding:4px 11px;font:inherit;font-size:12px;color:var(--ink);cursor:pointer}
.gr-chip:hover{border-color:var(--gold)}

/* ---------- a strand: lanes + wires ---------- */
.gr-strand{position:relative;background:rgba(255,255,255,.5);border:1px solid var(--stroke-soft);border-radius:var(--r-lg);padding:14px 16px 16px;min-width:0}
.gr-strand.is-compact{padding:10px 14px 12px;border-radius:var(--r-md)}
.gr-lanes{position:relative;display:grid;column-gap:52px;align-items:stretch}
.gr-lane{position:relative;z-index:1;display:flex;flex-direction:column;min-width:0}
.gr-lane-h{margin:0 0 10px;font-family:var(--body);font-size:10px;font-weight:600;letter-spacing:.12em;text-transform:uppercase;color:var(--ink-faint);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.gr-lane-h span{color:var(--ink-soft);font-variant-numeric:tabular-nums;margin-left:4px}
.is-compact .gr-lane-h{margin-bottom:6px}
.gr-strand.is-compact + .gr-strand.is-compact .gr-lane-h{display:none}
/* cards stack from the top; grTidy() in graph.js then drops each one level
   with what it joins (margin-top), the tidy-tree look */
.gr-lane-b{display:flex;flex-direction:column;justify-content:flex-start;gap:10px}
.is-compact .gr-lane-b{gap:7px}
.gr-wires{position:absolute;left:0;top:0;pointer-events:none;overflow:visible;z-index:0}

/* ---------- a card (the tree's .ft-node, in lane width) ---------- */
.gr-card{position:relative;display:flex;gap:10px;align-items:flex-start;padding:10px 12px;min-width:0;text-align:left;color:inherit;
  background:rgba(255,255,255,.9);border:1px solid var(--stroke-soft);border-radius:14px;box-shadow:0 8px 22px -18px rgba(60,46,20,.45);
  transition:border-color .15s,box-shadow .15s,opacity .15s,transform .15s}
.is-compact .gr-card{padding:8px 10px;border-radius:12px;gap:9px}
.gr-hit{position:absolute;inset:0;z-index:1;width:100%;border:0;background:transparent;border-radius:inherit;cursor:pointer;padding:0}
.gr-hit:focus-visible{outline:2px solid var(--gold);outline-offset:2px}
.gr-card:hover{border-color:rgba(169,130,76,.5);box-shadow:var(--shadow-soft)}
.gr-card.is-self{border:1.5px solid rgba(169,130,76,.6);background:linear-gradient(180deg,#fffdf8,#fbf6ea);box-shadow:0 0 0 4px rgba(169,130,76,.10),0 10px 26px -18px rgba(60,46,20,.5)}
.gr-card.is-ended{opacity:.62;border-style:dashed}
.gr-b{display:flex;flex-direction:column;gap:2px;min-width:0;flex:1}
.gr-rel{font-size:9.5px;font-weight:600;letter-spacing:.1em;text-transform:uppercase;color:var(--ink-faint);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.is-self .gr-rel{color:var(--gold-deep)}
.gr-name{font-family:var(--disp);font-weight:700;font-size:14px;line-height:1.2;color:var(--ink);overflow-wrap:anywhere}
.is-compact .gr-name{font-size:13px}
.gr-sub{font-size:11.5px;color:var(--ink-soft);overflow-wrap:anywhere}
.gr-line{font-size:11.5px;line-height:1.35;color:var(--ink-soft);overflow-wrap:anywhere}
.gr-muted{color:var(--ink-faint)}
.gr-flag{display:inline-block;font-size:10.5px;font-weight:600;padding:1px 7px;border-radius:99px;background:rgba(169,130,76,.14);color:var(--gold-deep)}
.gr-pills{display:flex;flex-wrap:wrap;gap:4px;margin:2px 0 1px}
.gr-pill{font-size:10.5px;font-weight:600;padding:1px 8px;border-radius:99px;background:rgba(26,27,24,.05);color:var(--ink-soft);max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.gr-pill-done{background:rgba(30,58,51,.10);color:var(--green)}
.gr-pill-open{background:rgba(169,130,76,.14);color:var(--gold-deep)}
.gr-pill-warn{background:rgba(216,184,119,.28);color:var(--gold-deep)}
.gr-pill-stop{background:rgba(140,59,46,.11);color:var(--red)}
.gr-pill-ended{background:rgba(26,27,24,.05);color:var(--ink-faint)}

/* avatar for people, a mark for everything else — the mark's shape is the
   type (circle employer, diamond location, ring filing) */
.gr-av{flex:0 0 auto;width:32px;height:32px;border-radius:50%;display:grid;place-items:center;font-family:var(--disp);font-weight:700;font-size:12px;color:#fff;background:var(--green-soft)}
.is-compact .gr-av{width:28px;height:28px;font-size:11px}
.gr-k-family .gr-av{background:#7A4A3A}
.is-self .gr-av{background:linear-gradient(145deg,var(--gold-hi),var(--gold-deep))}
.gr-mk{flex:0 0 auto;width:12px;height:12px;margin:4px 2px 0}
.gr-mk-employer{border-radius:50%;background:var(--gold-deep)}
.gr-mk-location{transform:rotate(45deg);background:var(--gold-hi);border-radius:2px;width:11px;height:11px;margin-top:5px}
.gr-mk-filing{border-radius:50%;border:2.5px solid var(--red-soft);background:var(--paper)}

.gr-centre{position:relative;z-index:2;flex:0 0 auto;width:26px;height:26px;margin:-3px -4px 0 0;border:1px solid transparent;border-radius:8px;background:transparent;color:var(--ink-faint);display:grid;place-items:center;cursor:pointer;padding:0}
.gr-centre svg{width:14px;height:14px}
.gr-centre:hover{color:var(--gold-deep);border-color:var(--stroke);background:var(--paper)}
.gr-centre:focus-visible{outline:2px solid var(--gold);outline-offset:1px}

/* ghosts: groups and overflows, never records */
.gr-ghost{display:flex;flex-direction:column;gap:1px;min-height:44px;justify-content:center;padding:8px 12px;border:1.5px dashed rgba(169,130,76,.4);border-radius:14px;background:rgba(255,255,255,.35);text-align:left;font:inherit;color:var(--ink-soft)}
.gr-ghost-t{font-size:12.5px;font-weight:600;color:var(--gold-deep)}
.gr-ghost-s{font-size:11px;color:var(--ink-soft)}
.gr-ghost.is-act{cursor:pointer}
.gr-ghost.is-act:hover{background:rgba(169,130,76,.07);border-color:var(--gold)}
.gr-ghost.is-act:focus-visible{outline:2px solid var(--gold);outline-offset:2px}

/* pipeline dots — the tree's, verbatim in meaning */
.gr-pipe{display:flex;align-items:center;gap:8px;margin-top:5px;padding-top:5px;border-top:1px solid var(--stroke-soft);min-width:0}
.gr-dots{display:flex;gap:4px;align-items:center}
.gr-d{display:block;width:8px;height:8px;border-radius:50%;border:1.3px dashed var(--ink-faint);background:transparent}
.gr-d-done{background:var(--green);border:1.3px solid var(--green)}
.gr-d-open{background:var(--gold);border:1.3px solid var(--gold)}
.gr-d-stop{background:var(--red);border:1.3px solid var(--red)}
.gr-d-ended{background:var(--ink-faint);border:1.3px solid var(--ink-faint)}
.gr-d-calm{background:var(--paper);border:1.8px solid var(--gold)}
.gr-d-warn{background:var(--gold-hi);border:1.3px solid var(--gold-deep)}
.gr-dots{flex:0 0 auto}
.gr-pipe-t{font-size:11px;line-height:1.3;color:var(--ink-faint);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.is-compact .gr-pipe{margin-top:3px;padding-top:0;border-top:0}
.is-compact .gr-sub{display:none}
.gr-pipe-t b{font-weight:600}
.gr-t-done b{color:var(--green)} .gr-t-open b,.gr-t-warn b{color:var(--gold-deep)} .gr-t-stop b{color:var(--red)} .gr-t-calm b{color:var(--ink)}

/* ---------- wires ---------- */
.gr-w path{fill:none;stroke:rgba(169,130,76,.7);stroke-width:1.7;transition:opacity .15s,stroke-width .15s}
.gr-w-operates path{stroke:rgba(169,130,76,.55)}
.gr-w-named path{stroke-dasharray:5 4}
.gr-w-employs path{stroke:var(--green-soft);opacity:.75}
.gr-w-family path{stroke:#7A4A3A;stroke-dasharray:2 5;stroke-linecap:round;stroke-width:2.2}
.gr-w-ended path{stroke:var(--ink-faint);stroke-dasharray:6 5}
.gr-w text{display:none;font-family:var(--body);font-size:10.5px;font-weight:600;fill:var(--ink-soft);paint-order:stroke;stroke:var(--paper);stroke-width:4px;stroke-linejoin:round}
.gr-w-family text,.gr-w-ended text,.gr-w.is-lit text{display:block}
.gr-w.is-lit text{fill:var(--ink)}
/* hover / focus: the lit card and its reach stay, the rest steps back */
.gr-lanes.is-hot .gr-card:not(.is-lit),.gr-lanes.is-hot .gr-ghost:not(.is-lit){opacity:.38}
.gr-lanes.is-hot .gr-w:not(.is-lit) path{opacity:.15}
.gr-lanes.is-hot .gr-w:not(.is-lit) text{display:none}
.gr-w.is-lit path{stroke-width:2.4;opacity:1}

/* ---------- legend ---------- */
.gr-legend{display:flex;flex-wrap:wrap;gap:6px 18px;padding-top:10px;border-top:1px solid var(--stroke-soft);font-size:11.5px;color:var(--ink-soft)}
.gr-legend > span{display:inline-flex;align-items:center;gap:7px}
.gr-lg{display:inline-block;width:24px;border-top:2px solid rgba(169,130,76,.7)}
.gr-lg-named{border-top-style:dashed}
.gr-lg-employs{border-top-color:var(--green-soft)}
.gr-lg-family{border-top:2.5px dotted #7A4A3A}
.gr-lg-ended{border-top:2px dashed var(--ink-faint)}
.gr-lg-sep{color:var(--ink-faint)}
.gr-lg-ic svg{width:12px;height:12px;vertical-align:-2px}

/* ---------- the phone rendering: an indented tree ---------- */
.gr-tree{list-style:none;margin:0;padding:0}
.gr-tree-root{display:none}
.gr-tree .gr-tree{position:relative;margin-left:14px;padding-left:14px;border-left:1.5px solid rgba(169,130,76,.45)}
.gr-ti{position:relative;margin-top:8px;display:flex;flex-direction:column;gap:3px}
.gr-tree-root > .gr-ti:first-child{margin-top:0}
.gr-tree .gr-tree > .gr-ti::before{content:"";position:absolute;left:-14px;top:22px;width:12px;border-top:1.5px solid rgba(169,130,76,.45)}
.gr-tree .gr-tree > .gr-ti-named::before{border-top-style:dashed}
.gr-tree .gr-tree > .gr-ti-family::before{border-top:2px dotted #7A4A3A}
.gr-tree .gr-tree > .gr-ti-employs::before{border-top-color:var(--green-soft)}
.gr-tree .gr-tree > .gr-ti:last-child{background:transparent}
.gr-tvia{font-size:10px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--ink-faint)}
.gr-talso{font-size:11px;color:var(--ink-soft);padding-left:4px}
.gr-tree .gr-card,.gr-tree .gr-ghost{width:100%}

/* ---------- widths ---------- */
@media (max-width:1180px){
  .gr-lanes{column-gap:36px}
  .gr-lenses{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:860px){
  .gr-lanes{display:none}
  .gr-head-t{order:1;flex:1 1 100%}
  .gr-backbtn{order:2}
  .gr-tree-root{display:block}
  .gr-strand{padding:12px}
  .gr-strand.is-compact + .gr-strand.is-compact .gr-lane-h{display:block}
  .gr-head{flex-wrap:wrap}
  .gr-head .btn{order:3;margin-left:auto}
  .gr-field{flex:1 1 100%}
}
@media (max-width:520px){
  .gr-lenses{grid-template-columns:1fr 1fr;gap:8px}
  .gr-lens{flex-direction:column;gap:4px;padding:10px 12px}
  .gr-lens b{font-size:19px}
  .gr-head h2{font-size:18px}
  .gr-tree .gr-tree{margin-left:8px;padding-left:10px}
  .gr-tree .gr-tree > .gr-ti::before{left:-10px;width:8px}
}
@media print{.gr-wires{display:none}}
@media (prefers-reduced-motion: reduce){.gr-card,.gr-w path{transition:none}}

/* ---------- dashboard card (graphDashboardCard()) ---------- */
.gr-dash{position:relative;overflow:hidden}
.gr-dash-strand{display:flex;align-items:center;gap:0;margin:6px 0 10px;flex-wrap:wrap;row-gap:6px}
.gr-dash-n{border:1px solid var(--stroke-soft);background:rgba(255,255,255,.9);border-radius:10px;padding:6px 10px;font-size:12px;color:var(--ink-soft)}
.gr-dash-e{font-family:var(--disp);font-weight:700;color:var(--ink)}
.gr-dash-strand i{display:inline-block;width:18px;border-top:1.7px solid rgba(169,130,76,.7)}
.gr-dash-strand i.d{border-top-style:dashed}
.gr-dash-foot{display:flex;justify-content:flex-end;font-size:11.5px}
.gr-dash-cta{color:var(--gold-deep);font-weight:600;cursor:pointer}
.gr-dash-cta:hover{text-decoration:underline}
