/* ============================================================================
   BLOOM — Attribution tree (DAG) styling
   ----------------------------------------------------------------------------
   Owns the member-facing lineage DAG on the record page (Propagation section).
   The tree lives on warm, identity-facing record pages, so nodes use the
   whimsy `.win` treatment: 22px radius, white rim, soft offset shadow. Typed
   edges are color-coded by CC branch (Adaptation = green, Remix = teal,
   Collection = gold) AND labeled, so type is never conveyed by color alone.

   The SVG is now the PRIMARY visual (no longer aria-hidden): it carries a
   role/label and its nodes are keyboard-reachable links. Below it, an
   equivalent accessible NESTED LIST (`.lintree__fallback`) restates the whole
   lineage as text — required by the global "every chart needs a table/list
   fallback" rule. Colors come only from badges.css tokens (defined inline in
   commons/index.html's :root); no off-palette hex.

   Loaded AFTER the page's inline <style>, so these rules win where they repeat
   the legacy `.lin*` selectors that used to live inline.
   ========================================================================== */

/* Typed-edge color map, expressed as tokens so a future palette shift is
   one-place. Adaptation = green, Remix = teal, Collection = gold. */
:root{
  --lin-adaptation:var(--green-deep);
  --lin-remix:var(--teal-deep);
  --lin-collection:var(--gold);
  --lin-adaptation-fill:var(--bar-green);
  --lin-remix-fill:var(--bar-teal);
  --lin-collection-fill:#EDE0C4;
  --lin-node-rim:#FFFFFF;
}

/* Whole figure. */
.lintree{margin:6px 0 18px;}
.lintree__intro{margin:0 0 8px;font-size:13.5px;color:var(--ink-soft);font-weight:600;}

/* Legend — text + swatch together (never color-only). */
.linlegend{display:flex;align-items:center;gap:14px;flex-wrap:wrap;margin:0 0 10px;
  font-family:"Baloo 2",system-ui,sans-serif;font-weight:700;font-size:12px;
  letter-spacing:.02em;text-transform:uppercase;color:var(--ink-soft);}
.linlegend__item{display:inline-flex;align-items:center;gap:6px;}
.linlegend__sw{width:14px;height:14px;border-radius:5px;border:2px solid;flex:none;}

/* Scroll wrapper — pans a wide DAG gracefully; never scrolls the page body. */
.lintree__scroll{overflow-x:auto;overflow-y:hidden;padding:8px 4px 10px;
  border-radius:var(--radius);
  background:linear-gradient(180deg,#F6FBF7,#FFFFFF);
  border:1.5px solid #DCEFE2;
  box-shadow:0 8px 0 rgba(18,81,58,.05);}
.lintree__scroll:focus-visible{outline:3px solid var(--teal);outline-offset:2px;}

/* The SVG itself — no longer aria-hidden. Nodes are `.win`-styled inside. */
.linsvg{display:block;margin:0 auto;height:auto;max-width:none;}
.linsvg a{cursor:pointer;text-decoration:none;}
.linsvg a:hover .linnode__box{filter:brightness(.98);}
.linsvg a:focus-visible{outline:none;}
.linsvg a:focus-visible .linnode__box{stroke-width:3.4;}
/* `.win`-style node: white rim + soft offset shadow, drawn as SVG filter-free
   layering (a lighter rim rect behind the fill rect reads as the white rim). */
.linnode__rim{fill:var(--lin-node-rim);}

/* -----------------------------------------------------------------------
   Accessible list fallback (the text equivalent of the DAG). Nested <ul>:
   ancestors, then the focal record (marked "this one"), then descendants.
   Kept visible for everyone — it doubles as the no-JS / screen-reader path.
   --------------------------------------------------------------------- */
.lintree__fallback{margin:12px 0 0;}
.lintree__fallback > .linlist{margin:0;padding:0;list-style:none;}
.linlist{margin:0;padding:0 0 0 20px;list-style:none;}
.linlist__item{position:relative;padding:6px 0;font-size:14px;line-height:1.45;}
.linlist__item::before{content:"";position:absolute;left:-14px;top:14px;
  width:8px;height:8px;border-radius:50%;background:#BBD9C6;}
.linlist__item--focal{font-weight:800;}
.linlist__item--focal::before{background:var(--green);width:10px;height:10px;left:-15px;}
.linlist__link{color:var(--green-deep);font-weight:700;text-decoration:none;
  border-bottom:1.5px solid transparent;}
.linlist__link:hover{border-bottom-color:var(--green-deep);}
.linlist__by{color:var(--ink-soft);font-weight:600;}
.linlist__ext{color:var(--muted);font-weight:600;font-style:italic;}
.linlist__meta{display:block;margin-top:2px;font-size:12.5px;color:var(--ink-soft);font-weight:600;}
/* Typed relation tag inside the list — text + color, mirrors the edge chips. */
.lintag{display:inline-block;padding:1px 8px;margin-right:6px;border-radius:9px;
  font-family:"Baloo 2",system-ui,sans-serif;font-weight:700;font-size:11px;
  letter-spacing:.02em;border:1.4px solid;vertical-align:1px;}
.lintag--adaptation{color:var(--lin-adaptation);border-color:var(--lin-adaptation);background:#fff;}
.lintag--remix{color:var(--lin-remix);border-color:var(--lin-remix);background:#fff;}
.lintag--collection{color:var(--lin-collection);border-color:var(--lin-collection);background:#fff;}
.linlist__caption{margin:0 0 6px;font-size:12.5px;color:var(--ink-soft);font-weight:700;
  text-transform:uppercase;letter-spacing:.04em;}

@media (max-width:640px){
  .lintree__scroll{box-shadow:0 5px 0 rgba(18,81,58,.05);}
}
