/* chart.css
   Org-chart-specific styles. style.css is the shared internal-tools
   stylesheet (tokens, topbar/brand, buttons, toolbar, empty states) —
   this file only adds what that one doesn't already cover, and reuses
   its --tokens throughout so this tool matches the rest of the family. */

.topbar-actions .stats-row { margin: 0; }

.content { padding-top: 22px; }

/* ---------- Toolbar row (search + team filter + expand/collapse) ---------- */
.toolbar select#deptFilter {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  font-family: var(--font);
  font-size: 13px;
  background: var(--white);
  min-width: 160px;
}
.toolbar select#deptFilter:focus { outline: 2px solid var(--pink-deep); }

/* ---------- Data source bar ---------- */
.datasource {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 16px;
}
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.dot.sample { background: var(--line); border: 1px solid #e2c3ba; }
.dot.live { background: var(--pink-deep); }

details.connect { font-size: 12.5px; }
details.connect summary {
  cursor: pointer;
  color: var(--pink-text);
  list-style: none;
  font-weight: 600;
}
details.connect summary::-webkit-details-marker { display: none; }

.connect-panel {
  margin-top: 12px;
  padding: 20px 22px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: 14px;
  max-width: 640px;
}
.connect-panel .row { display: flex; gap: 8px; flex-wrap: wrap; }
.connect-panel input[type="url"] {
  flex: 1 1 260px;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  font-family: var(--font);
  font-size: 13px;
  background: var(--paper);
}
.connect-panel input[type="url"]:focus { outline: 2px solid var(--pink-deep); background: var(--white); }
.connect-panel input[type="file"] { display: none; }
.fine-print { font-size: 12px; color: var(--muted); line-height: 1.5; margin: 0; }
.fine-print code, .connect-panel code {
  background: var(--gray);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 11.5px;
}
.status-msg { font-size: 12.5px; min-height: 16px; }
.status-msg.error { color: #a03a3a; }
.status-msg.ok { color: #46683f; }

/* ---------- Chart canvas ---------- */
.chart-scroll {
  overflow-x: auto;
  padding: 20px 4px 80px;
}
ul.tree, ul.tree ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
}
ul.tree { justify-content: center; }
ul.tree ul { padding-top: 44px; }
.tree li {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 16px;
}
.tree li::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: 44px;
  background: var(--line);
}
.tree > li::before { display: none; }
.tree ul::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--line);
}
.tree > ul { position: relative; }
li.only-child > ul::before { display: none; }
li.first-child > ul::before { left: 50%; }
li.last-child > ul::before { right: 50%; left: auto; }

.card {
  position: relative;
  width: 224px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 16px 16px 14px;
  text-align: left;
}
.card.match { border-color: var(--pink-deep); box-shadow: 0 0 0 3px rgba(242, 190, 178, 0.35), var(--shadow-soft); }

.card .avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--pink);
  color: var(--pink-text);
  font-size: 13px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 10px;
}
.card .dept {
  text-transform: uppercase;
  font-size: 10.5px;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 3px;
}
.card .name { font-weight: 700; font-size: 14.5px; color: var(--ink); }
.card .title { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.card .email {
  display: block;
  font-size: 11.5px;
  margin-top: 8px;
  color: var(--pink-text);
  text-decoration: none;
  word-break: break-all;
}
.card .email:hover { text-decoration: underline; }

.toggle {
  position: absolute;
  bottom: -13px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--white);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-soft);
}
.toggle:hover { background: var(--pink); color: var(--pink-text); }
li.collapsed > ul { display: none; }

.report-count { font-size: 10.5px; color: var(--muted); margin-top: 8px; }

.empty-state .wave { font-size: 26px; margin-bottom: 6px; }

button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--pink-deep);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

@media (max-width: 640px) {
  .topbar, .content { padding-left: 18px; padding-right: 18px; }
}
