/* Visual explorer. Shapes and colors come from the type tokens in app.css;
   each connection category has its own color AND dash pattern, so the
   legend still reads without color. */
:root {
  --e-investment: #1f4e79;
  --e-founding: #7b4fa0;
  --e-incubation: #2e7d5b;
  --e-participation: #a0662a;
  --e-service: #4f6d1f;
  --e-hosting: #b04a7a;
  --e-sponsorship: #8a6d3b;
  --e-management: #2a6f97;
  --e-association: #6b7682;
}

.ex-intro { margin: 4px 0 0; }
.ex-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.ex-main { min-width: 0; }
.ex-panel { position: sticky; top: 74px; }
@media (max-width: 1180px) {
  .ex-layout { grid-template-columns: 250px minmax(0, 1fr); }
  .ex-panel { grid-column: 2; position: static; }
}
@media (max-width: 900px) {
  .ex-layout { grid-template-columns: minmax(0, 1fr); }
  .ex-panel { grid-column: auto; }
}

/* view toggle */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--card); }
.seg button { border: 0; border-radius: 0; padding: 6px 14px; font-size: .9rem; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--primary); color: #fff; font-weight: 600; }

/* path */
.ex-trail ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; padding: 0; margin: 0 0 10px; font-size: .9rem; color: var(--ink-3); }
.ex-trail li { display: inline-flex; align-items: center; gap: 4px; }
.ex-trail li + li::before { content: "›"; color: var(--ink-3); margin-right: 4px; }
.ex-trail li[aria-current] { color: var(--ink); font-weight: 600; }
.ex-trail .linkish { font-size: inherit; }

/* graph */
.ex-graph { padding: 8px; overflow: hidden; }
.ex-scroll { overflow: auto; max-height: 76vh; }
.ex-svg { display: block; width: 100%; height: auto; font-family: inherit; }
.ex-svg.grid { max-width: 1100px; margin: 0 auto; }
.ex-svg.focus { margin: 0 auto; }
.ex-guide { fill: none; stroke: var(--line); stroke-width: 1.5; stroke-dasharray: 4 6; }
.ex-hint { fill: var(--ink-3); font-size: 15px; font-weight: 600; }
.ex-hint.small { font-size: 12px; font-weight: 400; }
.ex-node { cursor: pointer; outline: none; }
.ex-node .ex-logo-bg { fill: #fff; }
.ex-node .ex-logo-bg.broken { fill: var(--primary); }
.ex-node .ex-logo-init { fill: #fff; font-weight: 700; pointer-events: none; }
.ex-node .ex-shape { stroke: #fff; stroke-width: 2; vector-effect: non-scaling-stroke; }
.ex-node.t-capital_partner .ex-shape { fill: var(--t-capital_partner); }
.ex-node.t-startup .ex-shape { fill: var(--t-startup); }
.ex-node.t-eso .ex-shape { fill: var(--t-eso); }
.ex-node.t-venture_studio .ex-shape { fill: var(--t-venture_studio); }
.ex-node.t-fund .ex-shape { fill: var(--t-fund); }
.ex-node.t-program .ex-shape { fill: var(--t-program); }
.ex-node.t-event .ex-shape { fill: var(--t-event); }
.ex-node.t-resource .ex-shape { fill: var(--t-resource); }
.ex-node .ex-hit { fill: transparent; pointer-events: all; }
.ex-node .ex-ring { fill: none; stroke: transparent; stroke-width: 3; }
.ex-node:hover .ex-ring { stroke: #c5ced7; }
.ex-node:focus-visible .ex-ring { stroke: var(--primary); stroke-dasharray: 4 3; }
.ex-node.selected .ex-ring { stroke: var(--accent); stroke-dasharray: none; }
.ex-node.center .ex-ring { stroke: color-mix(in srgb, var(--primary) 35%, white); }
.ex-node.center.selected .ex-ring { stroke: var(--accent); }
.ex-node .ex-label { font-size: 13px; font-weight: 600; fill: var(--ink); paint-order: stroke; stroke: #fff; stroke-width: 4px; stroke-linejoin: round; }
.ex-node.center .ex-label { font-size: 15px; font-weight: 700; }
.ex-node .ex-sub { font-size: 12px; fill: var(--ink-3); paint-order: stroke; stroke: #fff; stroke-width: 4px; stroke-linejoin: round; }
.ex-node .ex-init { fill: #fff; font-weight: 700; pointer-events: none; }
.ex-node.dim { opacity: .38; }
.ex-node.dim:hover, .ex-node.dim:focus-visible { opacity: .75; }
.ex-note { margin: 6px 8px 2px; }
.ex-caption { font-size: 15px; font-weight: 700; fill: var(--ink); }
.ex-empty-filters .active-filters [data-clear] { display: none; }

/* connection categories: color plus dash */
.ex-edge { stroke-width: 2.2; fill: none; stroke-linecap: round; }
.ex-edge.dim { opacity: .3; }
.c-investment { --c: var(--e-investment); }
.c-founding { --c: var(--e-founding); }
.c-incubation { --c: var(--e-incubation); }
.c-participation { --c: var(--e-participation); }
.c-service { --c: var(--e-service); }
.c-hosting { --c: var(--e-hosting); }
.c-sponsorship { --c: var(--e-sponsorship); }
.c-management { --c: var(--e-management); }
.c-association { --c: var(--e-association); }
.ex-edge { stroke: var(--c, var(--ink-3)); }
.ex-edge.c-founding { stroke-dasharray: 10 4; }
.ex-edge.c-incubation { stroke-dasharray: 2 5; }
.ex-edge.c-participation { stroke-dasharray: 8 3 2 3; }
.ex-edge.c-service { stroke-dasharray: 5 4; }
.ex-edge.c-hosting { stroke-dasharray: 12 3 3 3; }
.ex-edge.c-sponsorship { stroke-dasharray: 1 5; stroke-width: 2.8; }
.ex-edge.c-management { stroke-width: 3.2; }
.ex-edge.c-association { stroke-dasharray: 6 6; }
.ex-glabel rect { fill: #fff; stroke: var(--c, var(--line)); stroke-width: 1.5; }
.ex-glabel text { font-size: 12px; font-weight: 600; fill: var(--ink); }

/* list */
.ex-list { padding: 14px 16px; }
.ex-lh { font-size: 1.05rem; margin: 4px 0 10px; }
.ex-groups { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.ex-groupbtn { width: 100%; justify-content: flex-start; gap: 10px; padding: 10px 12px; }
.ex-groupbtn .muted { margin-left: auto; font-size: .85rem; }
.ex-groupbtn[aria-disabled="true"] { opacity: .55; cursor: default; }
.ex-items { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 4px; }
.ex-item { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-bottom: 1px solid var(--line-2); }
.ex-item:last-child { border-bottom: 0; }
.ex-item.dim { opacity: .6; }
.ex-item-main { flex: 1; min-width: 0; }
.ex-item-main > a { font-weight: 600; }
.ex-item-main .row { gap: 6px 8px; margin-top: 2px; }
.ex-centerline { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.ex-centerline .ex-lh { margin: 0 0 4px; }
.ex-lgroup h3 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .98rem; margin: 10px 0 6px; }
.ex-lline { display: inline-block; width: 26px; height: 0; border-top: 3px solid var(--c, var(--ink-3)); vertical-align: middle; margin-right: 6px; }
.ex-lline.c-founding, .ex-lline.c-hosting { border-top-style: dashed; }
.ex-lline.c-incubation, .ex-lline.c-sponsorship { border-top-style: dotted; }
.ex-lline.c-participation, .ex-lline.c-service, .ex-lline.c-association { border-top-style: dashed; }
.ex-lshape { width: 18px; height: 18px; flex: none; vertical-align: middle; }

/* legend */
.ex-legend { margin-top: 12px; }
.ex-legend-inner { display: flex; flex-wrap: wrap; gap: 8px 32px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; }
.ex-legend-h { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-3); margin: 0 0 6px; }
.ex-legend ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .88rem; }
.ex-legend li { display: inline-flex; align-items: center; gap: 6px; }
.ex-lline-svg { width: 36px; height: 10px; }
.ex-lline-svg .ex-edge { stroke-width: 2.6; }

/* side panel */
.ex-panel-h { font-size: 1rem; }
.ex-steps { padding-left: 20px; margin: 0 0 10px; }
.ex-steps li { margin-bottom: 6px; }
.ex-panel-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.ex-panel-head > div { min-width: 0; }
.ex-panel .badge { white-space: normal; }
.ex-panel .btn { max-width: 100%; }
.ex-panel-name { font-size: 1.15rem; margin: 6px 0 2px; overflow-wrap: anywhere; }
.ex-panel-head p { margin: 0; }
.ex-panel-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ex-panel-foot { margin: 12px 0 0; }
.ex-empty-filters { margin: 8px 0 14px; display: flex; justify-content: center; }
.ex-empty-filters .active-filters { justify-content: center; margin: 0; }

@media (max-width: 760px) {
  .ex-scroll { max-height: none; }
  .ex-svg.wide { min-width: 400px; }
  .ex-svg.focus { min-width: 360px; }
  .ex-node .ex-label { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .ex-node, .ex-edge { transition: none; }
}
