[data-collection-graph] {
  --collection-ink: var(--life-dark-info, #173438); --collection-muted: var(--life-dark-muted, #647a7d);
  --collection-line: var(--life-dark-border, #d7e2df); --collection-surface: var(--life-dark-surface, #f3f8f7);
  --collection-accent: #17616a;
}
.collection-network-detail .collection-button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 38px;
  padding: 8px 12px; border: 1px solid var(--collection-accent); border-radius: 9px;
  background: var(--collection-accent); color: #fff; text-decoration: none;
}
.collection-network-detail .collection-button.secondary { background: var(--life-dark-surface, #fff); color: var(--life-dark-info, var(--collection-accent)); }
.collection-network-shell {
  max-width: 1320px; margin: 38px auto 70px; padding: 0 20px;
}
.collection-home-network {
  position: relative; max-width: 1180px; margin-top: 26px; margin-bottom: 24px;
}
.collection-home-network .collection-network-heading { align-items: center; }
.collection-home-network .collection-network-heading h2 {
  font-size: clamp(30px,4vw,42px);
}
.collection-home-network .collection-network-heading > div > p:last-child {
  margin-bottom: 0; color: var(--collection-muted);
}
.collection-home-network .collection-network-layout { min-height: 480px; }
.collection-home-network .collection-network-canvas { min-height: 480px; }
.collection-home-network .collection-network-detail { padding: 22px; }
.collection-home-network-toolbar label:first-child { max-width: 540px; }
.collection-home-network-toolbar .collection-button:last-child { margin-left: auto; }
.collection-network-heading {
  display: flex; justify-content: space-between; gap: 30px; align-items: end;
  margin-bottom: 20px;
}
.collection-network-heading h2, .collection-entity-hero h1,
.collection-entity-relations > h2, .collection-entity-recommendations > h2,
.collection-entity-network h2 { font-family: Georgia, serif; }
.collection-network-heading h2 { font-size: 38px; margin: 4px 0 8px; }
.collection-network-heading p { max-width: 780px; }
.collection-network-status { color: var(--collection-muted); font-size: 13px; text-align: right; }
.collection-network-toolbar {
  display: flex; flex-wrap: wrap; align-items: end; gap: 10px; padding: 14px;
  border: 1px solid var(--collection-line); border-radius: 16px 16px 0 0;
  background: var(--life-dark-surface, #f8fbfa);
}
.collection-network-toolbar label {
  display: grid; gap: 5px; min-width: 190px; color: var(--collection-muted);
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
}
.collection-network-toolbar input, .collection-network-toolbar select {
  min-height: 40px; border: 1px solid var(--life-dark-border, #b8c9c6); border-radius: 9px;
  background: var(--life-dark-surface, #fff); padding: 8px 11px; color: var(--collection-ink);
  font-size: 14px; text-transform: none; letter-spacing: normal;
}
.collection-network-toolbar label:first-child { flex: 1; min-width: 250px; }
.collection-network-toolbar .collection-button { min-height: 40px; padding: 8px 14px; }
.collection-network-search-results {
  position: absolute; z-index: 30; left: max(34px, calc((100vw - 1280px)/2));
  width: min(480px, calc(100vw - 68px)); max-height: 350px; overflow: auto;
  padding: 7px; border: 1px solid var(--collection-line); border-radius: 12px;
  background: var(--life-dark-surface, #fff); box-shadow: 0 18px 45px rgba(15,49,53,.18);
}
.collection-network-search-results button {
  display: grid; width: 100%; gap: 2px; padding: 10px; border: 0;
  border-radius: 8px; background: var(--life-dark-surface, #fff); text-align: left;
}
.collection-network-search-results button:hover,
.collection-network-search-results button:focus { background: var(--collection-surface); }
.collection-network-search-results span { color: var(--collection-muted); font-size: 12px; }
.collection-network-layout {
  display: grid; grid-template-columns: minmax(0,1fr) 330px; min-height: 650px;
  border: 1px solid var(--collection-line); border-top: 0;
  border-radius: 0 0 18px 18px; overflow: hidden;
}
.collection-network-canvas {
  position: relative; min-width: 0; min-height: 650px; touch-action: none;
  background: radial-gradient(circle at center,var(--life-dark-surface, #fff) 0,var(--life-dark-surface, #f6faf9) 78%);
}
.collection-network-canvas canvas { display: block; }
.collection-network-canvas .sigma-mouse { cursor: grab; }
.collection-network-canvas .sigma-mouse:active { cursor: grabbing; }
.collection-network-detail {
  border-left: 1px solid var(--collection-line); padding: 24px;
  background: var(--life-dark-surface, #fff); overflow: auto;
}
.collection-network-detail h3 { font: 700 26px Georgia,serif; margin: 4px 0 12px; }
.collection-sidebar-description { margin: 10px 0 14px; color: var(--collection-muted); }
.collection-sidebar-description .collection-richtext {
  position: relative; max-height: 3.25em; overflow: hidden; line-height: 1.6;
}
.collection-sidebar-description:not(.expanded) .collection-richtext::after {
  content: ""; position: absolute; right: 0; bottom: 0; left: 0; height: 1.8em;
  background: linear-gradient(transparent,var(--life-dark-surface, #fff));
}
.collection-sidebar-description.expanded .collection-richtext { max-height: none; }
.collection-sidebar-description .collection-richtext > :first-child { margin-top: 0; }
.collection-sidebar-description .collection-richtext > :last-child { margin-bottom: 0; }
.collection-description-toggle {
  border: 0; background: transparent; color: var(--life-dark-info, var(--collection-accent)); font-weight: 800;
  padding: 5px 0; cursor: pointer;
}
.collection-description-toggle:focus-visible { outline: 2px solid var(--collection-accent); outline-offset: 2px; }
.collection-network-detail ul { display: grid; gap: 7px; padding-left: 18px; }
.collection-network-detail li span {
  display: block; color: var(--collection-muted); font-size: 11px; text-transform: uppercase;
}
.collection-network-detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.collection-network-legend {
  display: flex; flex-wrap: wrap; gap: 14px; padding: 15px 5px;
  color: var(--collection-muted); font-size: 12px; text-transform: capitalize;
}
.collection-network-legend span { display: flex; align-items: center; gap: 6px; }
.collection-network-legend i, .collection-network-dot {
  display: inline-block; width: 11px; height: 11px; border-radius: 50%;
}
.collection-network-shell:fullscreen { padding: 18px; background: var(--life-dark-surface, #fff); overflow: auto; }
.collection-network-shell:fullscreen .collection-network-layout,
.collection-network-shell:fullscreen .collection-network-canvas { min-height: calc(100vh - 190px); }
.collection-entity-page {
  max-width: 1180px; margin: 15px auto 90px; color: var(--collection-ink);
  font-family: Inter,"Segoe UI",sans-serif;
}
.collection-entity-breadcrumb { display: flex; gap: 9px; align-items: center; padding: 18px 0; color: var(--collection-muted); }
.collection-entity-hero {
  display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 40px;
  align-items: end; padding: 48px; border-radius: 24px;
  background: linear-gradient(135deg,var(--life-dark-raised, #e8f4f1),var(--life-dark-raised, #fbf3e7));
}
.collection-entity-hero h1 { font-size: clamp(38px,6vw,64px); margin: 5px 0 15px; }
.collection-entity-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.collection-entity-layout { display: grid; grid-template-columns: minmax(0,1fr) 430px; gap: 28px; margin-top: 30px; }
.collection-entity-relations, .collection-entity-network, .collection-entity-recommendations {
  border: 1px solid var(--collection-line); border-radius: 18px; padding: 25px; background: var(--life-dark-surface, #fff);
}
.collection-entity-relations > h2, .collection-entity-recommendations > h2 { font-size: 32px; }
.collection-entity-relations > section { margin-top: 25px; }
.collection-entity-relations h3 {
  display: flex; justify-content: space-between; border-bottom: 1px solid var(--collection-line); padding-bottom: 8px;
}
.collection-entity-relations h3 span { color: var(--collection-muted); font-size: 13px; }
.collection-entity-link-list { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.collection-entity-link-list > a {
  display: flex; align-items: center; gap: 10px; padding: 11px;
  border-radius: 10px; color: var(--collection-ink); text-decoration: none!important;
}
.collection-entity-link-list > a:hover { background: var(--collection-surface); }
.collection-entity-link-list > a > span:last-child { display: grid; }
.collection-entity-link-list small { color: var(--collection-muted); text-transform: capitalize; }
.collection-network-dot.type-collection { background: #123f46; }
.collection-network-dot.type-project { background: #17616a; }
.collection-network-dot.type-person { background: #8c4f7d; }
.collection-network-dot.type-organisation { background: #976b22; }
.collection-network-dot.type-language { background: #4267a8; }
.collection-network-dot.type-resource { background: #47765b; }
.collection-network-dot.type-record { background: var(--life-dark-hover, #708486); }
.collection-entity-layout > aside { align-self: start; position: sticky; top: 20px; display: grid; gap: 18px; }
.collection-entity-metadata { display: flex; flex-wrap: wrap; gap: 12px 24px; margin: 20px 0 0; }
.collection-entity-metadata div { display: grid; gap: 2px; }
.collection-entity-metadata dt { color: var(--collection-muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.collection-entity-metadata dd { margin: 0; }
.collection-language-stat-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; }
.collection-language-stat-grid div { display: grid; padding: 12px; border-radius: 12px; background: var(--collection-surface); }
.collection-language-stat-grid strong { font-size: 24px; }
.collection-language-stat-grid span { color: var(--collection-muted); font-size: 12px; }
.collection-network-canvas.collection-network-canvas-local { min-height: 420px; }
.collection-entity-network .collection-network-detail { border: 0; border-top: 1px solid var(--collection-line); padding: 14px 0; }
.collection-entity-recommendations { margin-top: 28px; }
.collection-related-card { display: grid; gap: 5px; padding: 18px; color: var(--collection-ink); text-decoration: none!important; }
.collection-related-card > span { color: var(--life-dark-info, var(--collection-accent)); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.collection-related-card > strong { font: 700 19px Georgia,serif; }
.collection-related-card > small { color: var(--collection-muted); }
.collection-relationship-preview { margin: 14px 0; padding: 16px; border-left: 4px solid var(--collection-accent); border-radius: 10px; background: var(--collection-surface); }
.collection-relationship-preview p { margin: 6px 0; }
@media(max-width:950px) {
  .collection-network-layout, .collection-entity-layout { grid-template-columns: 1fr; }
  .collection-network-detail { border-left: 0; border-top: 1px solid var(--collection-line); }
  .collection-entity-layout > aside { position: static; }
  .collection-entity-page { margin-left: 18px; margin-right: 18px; }
  .collection-entity-link-list { grid-template-columns: 1fr; }
}
@media(max-width:650px) {
  .collection-network-heading, .collection-entity-hero { display: grid; grid-template-columns: 1fr; }
  .collection-network-toolbar > * { width: 100%; }
  .collection-network-layout, .collection-network-canvas { min-height: 520px; }
  .collection-entity-hero { padding: 28px; }
  .collection-entity-actions { align-items: stretch; flex-direction: column; }
  .collection-home-network { padding: 0; margin-left: 20px; margin-right: 20px; }
  .collection-home-network .collection-network-layout,
  .collection-home-network .collection-network-canvas { min-height: 430px; }
  .collection-home-network-toolbar .collection-button:last-child { margin-left: 0; }
}
@media(prefers-reduced-motion:reduce) {
  .collection-network-shell * { scroll-behavior: auto!important; transition: none!important; }
}

/* Grid/flex children may shrink; identifiers wrap without losing their text. */
.collection-entity-page, .collection-network-shell, .collection-network-detail {
  overflow-wrap: anywhere;
}
.collection-entity-page :is(header, section, aside, nav, a, h1, h2, h3, h4, strong, p, li, dd),
.collection-network-layout > *, .showcase-project-network-layout > *,
.collection-entity-link-list > a > span:last-child { min-width: 0; }
.collection-network-detail :is(h3, a, span, p),
.collection-network-search-results :is(button, strong, span),
.collection-entity-page :is(h1, h2, h3, h4, strong, p, li, dd) {
  overflow-wrap: anywhere; word-break: normal; white-space: normal;
}
.collection-network-dot { flex-shrink: 0; }
.collection-entity-link-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media(max-width:950px) { .collection-entity-link-list { grid-template-columns: minmax(0, 1fr); } }
