/* A quiet, navigable canvas lets the people and their connections lead. */
.coaching-tree-canvas {
  --tree-paper: #f3f6fb;
  --tree-ink: #15213a;
  --tree-muted: #596b85;
  --tree-line: #acbdd5;
  --tree-card: #fff;
  --tree-border: #dbe1e9;
  --tree-grid: #cbd5e5;
  position: relative;
  height: clamp(580px, 68vh, 800px);
  border: 1px solid var(--tree-border);
  border-radius: 10px;
  isolation: isolate;
  background-color: var(--tree-paper);
  background-image: radial-gradient(ellipse at 50% 48%, #dce7fa40, transparent 60%), radial-gradient(var(--tree-grid) 0.8px, transparent 0.8px);
  background-size: 100% 100%, 20px 20px;
  box-shadow: inset 0 1px 0 #fff8, 0 8px 30px -20px #153e3530;
}
.coaching-tree-svg { display: block; cursor: grab; touch-action: none; }
.coaching-tree-svg:active { cursor: grabbing; }
.tree-toolbar {
  position: absolute;
  z-index: 2;
  inset: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 25px 25px;
  background: linear-gradient(var(--tree-paper) 70%, transparent);
  pointer-events: none;
}
.tree-heading { display: grid; gap: 3px; min-width: 0; }
.tree-eyebrow { color: var(--tree-muted); font: 700 9px/1.2 var(--font-body); letter-spacing: 2px; }
.tree-title { color: var(--tree-ink); font: 700 21px/1.2 var(--font-display); }
.tree-count { color: var(--tree-muted); font: 400 11px/1.5 var(--font-body); }
.tree-zoom-controls {
  position: absolute;
  z-index: 2;
  bottom: 18px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 1px;
  padding: 3px;
  border: 1px solid var(--tree-border);
  border-radius: 12px;
  background: var(--tree-card);
  color: var(--tree-ink);
  box-shadow: 0 3px 10px #153e350c;
}
.tree-zoom-controls button { min-width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; font: 500 21px/1 var(--font-body); cursor: pointer; }
.tree-zoom-controls button:hover { background: var(--tree-paper); }
.tree-zoom-controls .tree-fit-button { font-size: 12px; font-weight: 700; padding: 0 10px; }
.tree-zoom-controls .tree-zoom-label { min-width: 38px; text-align: center; font: 500 11px/1 var(--font-body); font-variant-numeric: tabular-nums; }
.tree-control-divider { width: 1px; height: 19px; margin: 0 4px; background: var(--tree-border); }
.tree-instructions { position: absolute; bottom: 30px; left: 25px; display: flex; align-items: center; gap: 8px; color: var(--tree-muted); font: 400 11px/1.5 var(--font-body); pointer-events: none; }
.tree-status-dot { width: 6px; height: 6px; border-radius: 50%; background: #669b77; box-shadow: 0 0 0 4px #669b7714; }
.tree-instructions > span:last-child { padding: 3px 0; background: var(--tree-paper); }
.tree-connection { fill: none; stroke: var(--tree-line); stroke-width: 1.5; transition: stroke 150ms; }
.tree-connection.is-highlighted { stroke: var(--tree-ink); stroke-width: 2.5; }
.tree-card-surface { fill: var(--tree-card); stroke: var(--tree-border); stroke-width: 1; filter: drop-shadow(0 3px 4px #173c3510); transition: stroke 150ms; }
.tree-coach.is-connected .tree-card-surface { stroke: var(--tree-ink); }
.tree-profile { cursor: pointer; outline: none; }
.tree-profile-hit { fill: transparent; stroke: transparent; stroke-width: 2; }
.tree-portrait-ring { fill: var(--tree-paper); stroke: var(--coach-color); stroke-width: 1.8; }
.tree-portrait { clip-path: circle(50%); pointer-events: none; }
.tree-initials { fill: var(--tree-ink); text-anchor: middle; font: 700 18px var(--font-body); }
.tree-coach-name { fill: var(--tree-ink); font: 700 18px var(--font-body); }
.tree-coach-role { fill: var(--tree-muted); font: 500 9px var(--font-body); letter-spacing: 0.8px; }
.tree-origin .tree-card-surface { fill: #15213a; stroke: #284873; filter: drop-shadow(0 7px 12px #173c3526); }
.tree-origin .tree-portrait-ring { stroke: #8baef1; fill: #2a4064; }
.tree-origin .tree-coach-name { fill: #fff; font-size: 20px; }
.tree-origin .tree-coach-role { fill: #b4c7e9; font-size: 8px; letter-spacing: 1.2px; }
.tree-origin .tree-initials { fill: #fff; }
.tree-profile:focus-visible .tree-profile-hit { stroke: var(--tree-ink); stroke-width: 2; }
.tree-origin .tree-profile:focus-visible .tree-profile-hit { stroke: #d9f5df; }
.tree-zoom-controls button:focus-visible { outline: 2px solid var(--tree-ink); outline-offset: 3px; }
.dark .coaching-tree-canvas {
  --tree-paper: #17202e;
  --tree-ink: #e3edfc;
  --tree-muted: #a5b6d1;
  --tree-line: #495e7b;
  --tree-card: #243248;
  --tree-border: #3d506d;
  --tree-grid: #2e405a;
  background-image: radial-gradient(ellipse at 50% 48%, #294b7838, transparent 60%), radial-gradient(var(--tree-grid) 0.8px, transparent 0.8px);
  box-shadow: none;
}
@media (max-width: 639px) {
  .coaching-tree-canvas { height: 620px; max-height: 82svh; min-height: 500px; border-radius: 8px; }
  .tree-toolbar { padding: 17px 16px 22px; flex-wrap: wrap; gap: 10px; }
  .tree-heading { flex: 1 1 100%; }
  .tree-title { font-size: 20px; }
  .tree-zoom-controls { bottom: 14px; right: 13px; }
  .tree-instructions { bottom: 28px; left: 17px; font-size: 10px; }
  .tree-desktop-hint { display: none; }
  .tree-status-dot { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .tree-connection, .tree-card-surface { transition: none; }
}
