:root {
  --bg: #ffffff;
  --ink: #1a2428;

  /* Лестница зелёных: роль (макс) → грейд → тип → навык (тише) */
  --role: #0d9b8a;
  --role-deep: #087a6d;
  --role-ink: #0a2e2a;
  --grade: #3aada0;
  --grade-ink: #0a2e2a;
  --kind: #7ec9bc;
  --kind-ink: #0d4f47;
  --skill: #e5f3f0;
  --skill-ink: #3a5c56;
  --skill-border: rgba(13, 155, 138, 0.14);
  --skill-lit: #d5ebe6;
  --skill-lit-ink: #2f6f66;
  --skill-custom: rgba(13, 155, 138, 0.28);
  --skill-custom-ink: #0d6b5e;
  --skill-custom-border: rgba(13, 155, 138, 0.42);
  --skill-custom-lit: rgba(13, 155, 138, 0.42);
  --skill-mastered: rgba(132, 204, 22, 0.32);
  --skill-mastered-ink: #3f6212;
  --skill-mastered-border: rgba(101, 163, 13, 0.45);
  --skill-mastered-lit: rgba(132, 204, 22, 0.48);
  --skill-confirmed: rgba(56, 189, 248, 0.38);
  --skill-confirmed-ink: #075985;
  --skill-confirmed-border: rgba(14, 165, 233, 0.55);
  --skill-confirmed-lit: rgba(56, 189, 248, 0.52);
  --skill-free: rgba(244, 114, 182, 0.3);
  --skill-free-ink: #9d174d;
  --skill-free-border: rgba(236, 72, 153, 0.45);
  --skill-free-lit: rgba(244, 114, 182, 0.45);
  --focus-border: rgba(13, 155, 138, 0.28);
  --focus-link: #7ec9bc;
  --link-skill: #9aa7ad;
  --tool-bg: rgba(255, 255, 255, 0.92);
  --tool-bg-hover: #e8f5f1;
  --panel-bg: rgba(255, 255, 255, 0.96);
  --legend-bg: rgba(255, 255, 255, 0.92);
  --surface: #f3faf8;

  /* Миллиметровка / чертёжная бумага */
  --paper: #ffffff;
  --grid-minor: rgba(58, 110, 155, 0.22);
  --grid-mid: rgba(42, 95, 145, 0.34);
  --grid-major: rgba(28, 78, 128, 0.48);
  --grid-unit: 10px;

  --font: "Manrope", sans-serif;
  --display: "Sora", sans-serif;
}

html[data-theme="dark"] {
  --bg: #0f1618;
  --ink: #e6f2ef;
  /* Роль — самый яркий; дальше каждый уровень тише */
  --role: #2dd4bf;
  --role-deep: #14b8a6;
  --role-ink: #ffffff;
  --grade: #1a9b8c;
  --grade-ink: #ffffff;
  --kind: #3d7f76;
  --kind-ink: #d7f5f0;
  --skill: #1a2c2a;
  --skill-ink: #b7d4ce;
  --skill-border: rgba(45, 212, 191, 0.22);
  --skill-lit: #243d39;
  --skill-lit-ink: #d5f3ed;
  --skill-custom: rgba(45, 212, 191, 0.28);
  --skill-custom-ink: #b8fff3;
  --skill-custom-border: rgba(45, 212, 191, 0.45);
  --skill-custom-lit: rgba(45, 212, 191, 0.4);
  --skill-mastered: rgba(163, 230, 53, 0.28);
  --skill-mastered-ink: #ecfccb;
  --skill-mastered-border: rgba(163, 230, 53, 0.5);
  --skill-mastered-lit: rgba(163, 230, 53, 0.4);
  --skill-confirmed: rgba(56, 189, 248, 0.32);
  --skill-confirmed-ink: #e0f2fe;
  --skill-confirmed-border: rgba(125, 211, 252, 0.55);
  --skill-confirmed-lit: rgba(56, 189, 248, 0.45);
  --skill-free: rgba(244, 114, 182, 0.28);
  --skill-free-ink: #fce7f3;
  --skill-free-border: rgba(244, 114, 182, 0.5);
  --skill-free-lit: rgba(244, 114, 182, 0.4);
  --focus-border: rgba(45, 212, 191, 0.4);
  --focus-link: #5eead4;
  --link-skill: #6b8580;
  --tool-bg: rgba(22, 32, 34, 0.92);
  --tool-bg-hover: #1e3330;
  --panel-bg: rgba(18, 28, 30, 0.96);
  --legend-bg: rgba(18, 28, 30, 0.92);
  --surface: #162422;
  --paper: #101618;
  --grid-minor: rgba(110, 175, 165, 0.14);
  --grid-mid: rgba(110, 175, 165, 0.24);
  --grid-major: rgba(130, 200, 188, 0.36);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  overflow: hidden;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
}

.graph-page {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--paper);
}

.graph {
  position: fixed;
  inset: 0;
  overflow: hidden;
  transform-origin: center center;
  touch-action: none;
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid-major) 1.5px, transparent 1.5px),
    linear-gradient(90deg, var(--grid-major) 1.5px, transparent 1.5px),
    linear-gradient(var(--grid-mid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-mid) 1px, transparent 1px),
    linear-gradient(var(--grid-minor) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-minor) 1px, transparent 1px);
  background-size:
    calc(var(--grid-unit) * 10) calc(var(--grid-unit) * 10),
    calc(var(--grid-unit) * 10) calc(var(--grid-unit) * 10),
    calc(var(--grid-unit) * 5) calc(var(--grid-unit) * 5),
    calc(var(--grid-unit) * 5) calc(var(--grid-unit) * 5),
    var(--grid-unit) var(--grid-unit),
    var(--grid-unit) var(--grid-unit);
  background-position: center center;
}

.graph.is-zooming {
  will-change: transform;
  cursor: grab;
}

.graph.is-zooming.is-panning {
  cursor: grabbing;
}

/* Гостевое превью: полный скелет, приглушённые узлы, яркое ядро */
.graph.is-placeholder .grade-node {
  cursor: default;
  letter-spacing: 0.22em;
  opacity: 0.78;
  color: color-mix(in srgb, var(--ink) 42%, transparent);
  background: color-mix(in srgb, var(--grade) 34%, var(--paper));
  border-color: color-mix(in srgb, var(--grade) 22%, transparent);
  filter: saturate(0.45);
  pointer-events: none;
  user-select: none;
}

.graph.is-placeholder .kind-node {
  cursor: default;
  letter-spacing: 0.22em;
  opacity: 0.75;
  color: color-mix(in srgb, var(--ink) 38%, transparent);
  background: color-mix(in srgb, var(--kind) 36%, var(--paper));
  border-color: color-mix(in srgb, var(--kind) 20%, transparent);
  filter: saturate(0.45);
  pointer-events: none;
  user-select: none;
}

.graph.is-placeholder .skill-tag {
  cursor: default;
  letter-spacing: 0.22em;
  opacity: 0.75;
  color: color-mix(in srgb, var(--ink) 38%, transparent);
  background: color-mix(in srgb, var(--kind) 36%, var(--paper));
  border-color: color-mix(in srgb, var(--kind) 20%, transparent);
  filter: saturate(0.45);
  pointer-events: none;
  user-select: none;
}

.graph.is-placeholder .hub {
  z-index: 40;
  box-shadow: none;
  filter: none;
  opacity: 1;
}

.graph.is-placeholder .link-hub {
  stroke: var(--role) !important;
  stroke-width: 2.4;
  opacity: 0.72;
}

.graph.is-placeholder .link-kind {
  stroke: var(--grade) !important;
  stroke-width: 1.9;
  opacity: 0.65;
}

.graph.is-placeholder .link-skill {
  stroke: var(--kind) !important;
  stroke-width: 1.5;
  opacity: 0.58;
}

.graph.is-placeholder .graph-legend {
  opacity: 0.5;
  pointer-events: none;
}

.graph-links {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.graph-links .link-hub,
.graph-links .link-kind,
.graph-links .link-skill {
  transition:
    stroke 0.25s ease,
    stroke-width 0.25s ease,
    opacity 0.25s ease;
}

.graph-links .link-hub {
  stroke: var(--role);
  stroke-width: 2.4;
  opacity: 0.45;
}

.graph-links .link-kind {
  stroke: var(--grade);
  stroke-width: 1.8;
  opacity: 0.4;
}

.graph-links .link-skill {
  stroke: var(--link-skill);
  stroke-width: 1;
  opacity: 0.28;
}

.graph.is-focusing .link-hub,
.graph.is-focusing .link-kind,
.graph.is-focusing .link-skill {
  opacity: 0.14;
}

.graph.is-focusing .link-kind.is-lit {
  stroke: var(--focus-link);
  stroke-width: 1.85;
  opacity: 0.72;
}

.graph.is-focusing .link-skill.is-lit {
  stroke: var(--focus-link);
  stroke-width: 1.55;
  opacity: 0.62;
}

.graph-nodes {
  position: absolute;
  inset: 0;
  z-index: 2;
}

/* Уровень 1 — роль */
.hub {
  position: absolute;
  z-index: 30;
  left: 50%;
  top: 50%;
  width: clamp(7.2rem, 12vmin, 10rem);
  height: clamp(7.2rem, 12vmin, 10rem);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(circle at 35% 30%, #1bc4b0 0%, var(--role) 48%, var(--role-deep) 100%);
  box-shadow: none;
  padding: 0.65rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition:
    opacity 0.25s ease,
    filter 0.25s ease;
}

.hub-input {
  display: block;
  flex: 0 1 auto;
  width: 100%;
  max-height: 100%;
  margin: 0;
  border: 0;
  background: transparent;
  color: var(--role-ink);
  text-align: center;
  font-family: var(--display);
  font-size: clamp(0.7rem, 1.7vmin, 0.95rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  outline: none;
  resize: none;
  overflow: hidden;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 1.15em;
}

.hub-input::placeholder {
  color: color-mix(in srgb, var(--role-ink) 70%, transparent);
  text-align: center;
  white-space: pre-line;
}

/* Уровень 2 — грейды */
.grade-node {
  position: absolute;
  z-index: 20;
  transform: translate(-50%, -50%);
  min-width: 5.2rem;
  padding: 0.55rem 1.05rem;
  border-radius: 999px;
  font-family: var(--display);
  font-size: clamp(0.72rem, 1.45vmin, 0.92rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
  color: var(--grade-ink);
  background: var(--grade);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: none;
  white-space: nowrap;
  user-select: none;
  cursor: pointer;
  transition:
    border-color 0.25s ease,
    filter 0.25s ease,
    opacity 0.25s ease;
}

/* Уровень 3 — hard / soft (один цвет уровня) */
.kind-node {
  position: absolute;
  z-index: 18;
  transform: translate(-50%, -50%);
  min-width: 4.6rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  font-family: var(--display);
  font-size: clamp(0.58rem, 1.15vmin, 0.72rem);
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-align: center;
  color: var(--kind-ink);
  background: var(--kind);
  border: 1px solid rgba(13, 155, 138, 0.2);
  box-shadow: none;
  white-space: nowrap;
  user-select: none;
  cursor: pointer;
  transition:
    border-color 0.25s ease,
    filter 0.25s ease,
    opacity 0.25s ease;
}

/* Уровень 4 — навыки */
.skill-tag {
  position: absolute;
  z-index: 10;
  transform: translate(-50%, -50%);
  max-width: 8.8rem;
  padding: 0.32rem 0.62rem;
  border-radius: 999px;
  font-size: clamp(0.58rem, 1.1vmin, 0.72rem);
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  color: var(--skill-ink);
  background: var(--skill);
  border: 1px solid var(--skill-border);
  box-shadow: none;
  animation: none;
  cursor: grab;
  touch-action: none;
  user-select: none;
  transition:
    background 0.25s ease,
    color 0.25s ease,
    border-color 0.25s ease,
    opacity 0.25s ease,
    filter 0.25s ease;
}

.skill-tag.is-dragging {
  cursor: grabbing;
  z-index: 40;
  opacity: 0.92;
  transition: none;
}

.graph.is-focusing .hub {
  opacity: 0.48;
  filter: none;
}

.graph.is-focusing .grade-node:not(.is-lit),
.graph.is-focusing .kind-node:not(.is-lit),
.graph.is-focusing .skill-tag:not(.is-lit) {
  opacity: 0.42;
  filter: none;
}

.graph.is-focusing .grade-node.is-lit {
  border-color: var(--focus-border);
  filter: none;
}

.graph.is-focusing .kind-node.is-lit {
  border-color: var(--focus-border);
  filter: none;
}

.graph.is-focusing .skill-tag.is-lit {
  background: var(--skill-lit);
  color: var(--skill-lit-ink);
  border-color: var(--focus-border);
  z-index: 15;
}

.skill-tag.is-custom {
  background: var(--skill-custom);
  color: var(--skill-custom-ink);
  border-color: var(--skill-custom-border);
}

.graph.is-focusing .skill-tag.is-custom.is-lit {
  background: var(--skill-custom-lit);
  color: var(--skill-custom-ink);
  border-color: var(--focus-border);
}

.skill-tag.is-mastered,
.skill-tag.is-custom.is-mastered {
  background: var(--skill-mastered);
  color: var(--skill-mastered-ink);
  border-color: var(--skill-mastered-border);
}

.graph.is-focusing .skill-tag.is-mastered.is-lit,
.graph.is-focusing .skill-tag.is-custom.is-mastered.is-lit {
  background: var(--skill-mastered-lit);
  color: var(--skill-mastered-ink);
  border-color: var(--focus-border);
}

.skill-tag.is-free {
  background: var(--skill-free);
  color: var(--skill-free-ink);
  border-color: var(--skill-free-border);
}

.graph.is-focusing .skill-tag.is-free.is-lit {
  background: var(--skill-free-lit);
  color: var(--skill-free-ink);
  border-color: var(--focus-border);
}

.skill-tag.is-free.is-mastered {
  background: var(--skill-mastered);
  color: var(--skill-mastered-ink);
  border-color: var(--skill-mastered-border);
}

/* Confirmed by ≥1 user — голубой */
.skill-tag.has-confirm,
.skill-tag.is-custom.has-confirm,
.skill-tag.is-free.has-confirm,
.skill-tag.is-mastered.has-confirm,
.skill-tag.is-custom.is-mastered.has-confirm,
.skill-tag.is-free.is-mastered.has-confirm {
  background: var(--skill-confirmed);
  color: var(--skill-confirmed-ink);
  border-color: var(--skill-confirmed-border);
}

.graph.is-focusing .skill-tag.has-confirm.is-lit,
.graph.is-focusing .skill-tag.is-custom.has-confirm.is-lit,
.graph.is-focusing .skill-tag.is-mastered.has-confirm.is-lit {
  background: var(--skill-confirmed-lit);
  color: var(--skill-confirmed-ink);
  border-color: var(--focus-border);
}

/* Легенда цветов — оверлей, граф не сдвигается */
.graph-legend {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 40;
  margin: 0;
  padding: 0.75rem 0.9rem;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 8.5rem;
  border-radius: 0.9rem;
  border: 1px solid var(--skill-border);
  background: var(--legend-bg);
  pointer-events: none;
  user-select: none;
}

.graph-legend-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--skill-ink);
}

.graph-legend-swatch {
  flex: 0 0 auto;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 999px;
  border: 1px solid transparent;
}

.graph-legend-swatch.is-role {
  background: var(--role);
}

.graph-legend-swatch.is-grade {
  background: var(--grade);
}

.graph-legend-swatch.is-kind {
  background: var(--kind);
  border-color: rgba(13, 155, 138, 0.2);
}

.graph-legend-swatch.is-skill {
  background: var(--skill);
  border-color: var(--skill-border);
}

.graph-legend-swatch.is-mastered {
  background: var(--skill-mastered);
  border-color: var(--skill-mastered-border);
}

.graph-legend-swatch.is-confirmed {
  background: var(--skill-confirmed);
  border-color: var(--skill-confirmed-border);
}

.graph-legend-swatch.is-free {
  background: var(--skill-free);
  border-color: var(--skill-free-border);
}

/* Правый низ — мнемоники: поделиться / поиск */
.graph-tools {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.55rem;
  pointer-events: none;
}

.graph-tools > * {
  pointer-events: auto;
}

.graph-tools-btns {
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
}

.graph-tool-btn {
  width: 2.75rem;
  height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.85rem;
  border: 1px solid var(--skill-border);
  background: var(--tool-bg);
  color: var(--role-deep);
  cursor: pointer;
  padding: 0;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.graph-tool-btn:hover,
.graph-tool-btn.is-active {
  background: var(--tool-bg-hover);
  border-color: var(--focus-border);
  color: var(--role);
}

.graph-tool-btn:focus-visible {
  outline: 2px solid var(--kind);
  outline-offset: 2px;
}

.graph-tool-btn svg {
  width: 1.2rem;
  height: 1.2rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.graph-theme-icon.is-moon {
  fill: currentColor;
  stroke: none;
}

.graph-theme-icon.is-sun {
  fill: none;
  stroke: currentColor;
}

.graph-tool-btn.is-ok {
  color: var(--grade);
  border-color: rgba(58, 173, 160, 0.35);
}

.graph-search {
  width: min(18rem, calc(100vw - 2rem));
  padding: 0.65rem;
  border-radius: 0.9rem;
  border: 1px solid var(--skill-border);
  background: var(--panel-bg);
  display: none;
  flex-direction: column;
  gap: 0.45rem;
}

.graph-tools.is-search-open .graph-search {
  display: flex;
}

.graph-add-skill {
  width: min(18rem, calc(100vw - 2rem));
  padding: 0.65rem;
  border-radius: 0.9rem;
  border: 1px solid var(--skill-border);
  background: var(--panel-bg);
  display: none;
  flex-direction: column;
  gap: 0.45rem;
}

.graph-tools.is-add-skill-open .graph-add-skill {
  display: flex;
}

.graph-attach {
  width: min(18rem, calc(100vw - 2rem));
  padding: 0.65rem;
  border-radius: 0.9rem;
  border: 1px solid var(--skill-border);
  background: var(--panel-bg);
  display: none;
  flex-direction: column;
  gap: 0.45rem;
}

.graph-tools.is-attach-open .graph-attach {
  display: flex;
}

.graph-zoom {
  display: none;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem;
  border-radius: 0.85rem;
  border: 1px solid var(--skill-border);
  background: var(--panel-bg);
}

.graph-tools.is-zoom-open .graph-zoom {
  display: flex;
}

.graph-share {
  display: none;
  flex-direction: column;
  gap: 0.85rem;
  width: min(22rem, calc(100vw - 2rem));
  padding: 1rem 1.05rem 0.85rem;
  border-radius: 0.9rem;
  border: 1px solid var(--skill-border);
  background: var(--panel-bg);
  box-shadow:
    0 10px 28px rgba(10, 46, 42, 0.12),
    0 1px 0 rgba(255, 255, 255, 0.4) inset;
}

.graph-tools.is-share-open .graph-share {
  display: flex;
}

.graph-export {
  display: none;
  flex-direction: column;
  gap: 0.85rem;
  width: min(22rem, calc(100vw - 2rem));
  padding: 1rem 1.05rem 0.85rem;
  border-radius: 0.9rem;
  border: 1px solid var(--skill-border);
  background: var(--panel-bg);
  box-shadow:
    0 10px 28px rgba(10, 46, 42, 0.12),
    0 1px 0 rgba(255, 255, 255, 0.4) inset;
}

.graph-tools.is-export-open .graph-export {
  display: flex;
}

.graph-export-check {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font: 600 0.86rem/1.3 Manrope, sans-serif;
  color: var(--ink);
  cursor: pointer;
}

.graph-export-check input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--role);
}

.graph-export-actions {
  flex-wrap: wrap;
}

.graph-export-dismiss {
  margin: 0;
  padding: 0.2rem 0.1rem;
  border: 0;
  background: transparent;
  color: var(--skill-ink);
  font: 600 0.78rem/1.2 Manrope, sans-serif;
  text-align: left;
  cursor: pointer;
}

.graph-export-dismiss:hover {
  color: var(--role-deep);
  text-decoration: underline;
}

.graph-share-head {
  margin: 0;
}

.graph-share-title {
  margin: 0;
  font: 700 1.05rem/1.25 Manrope, sans-serif;
  color: var(--ink, #1a2428);
  letter-spacing: -0.01em;
}

.graph-share-section {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.graph-share-label {
  font: 600 0.72rem/1.2 Manrope, sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--ink, #1a2428) 55%, transparent);
}

.graph-share-email-row {
  display: flex;
  gap: 0.4rem;
}

.graph-share-email {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--skill-border);
  border-radius: 0.55rem;
  background: var(--surface, var(--panel-bg));
  color: var(--ink, #1a2428);
  font: 500 0.88rem/1.2 Manrope, sans-serif;
}

.graph-share-email:focus {
  outline: 2px solid color-mix(in srgb, var(--role) 45%, transparent);
  outline-offset: 1px;
  border-color: var(--role);
}

.graph-share-grant,
.graph-share-copy,
.graph-share-done {
  margin: 0;
  padding: 0.55rem 0.75rem;
  border: 0;
  border-radius: 0.55rem;
  font: 600 0.82rem/1.2 Manrope, sans-serif;
  cursor: pointer;
  white-space: nowrap;
}

.graph-share-grant {
  background: color-mix(in srgb, var(--role) 16%, transparent);
  color: var(--role-deep);
}

.graph-share-grant:hover {
  background: color-mix(in srgb, var(--role) 28%, transparent);
}

.graph-share-people {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 7.5rem;
  overflow: auto;
}

.graph-share-person {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.45rem;
  border-radius: 0.55rem;
  background: color-mix(in srgb, var(--role) 7%, transparent);
}

.graph-share-person-avatar {
  flex: 0 0 auto;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--role) 22%, transparent);
  color: var(--role-deep);
  font: 700 0.72rem/1 Manrope, sans-serif;
  text-transform: uppercase;
}

.graph-share-person-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.graph-share-person-email {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink, #1a2428);
  font: 600 0.82rem/1.2 Manrope, sans-serif;
}

.graph-share-person-role {
  color: color-mix(in srgb, var(--ink, #1a2428) 55%, transparent);
  font: 500 0.72rem/1.2 Manrope, sans-serif;
}

.graph-share-person-remove {
  flex: 0 0 auto;
  width: 1.55rem;
  height: 1.55rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0.4rem;
  background: transparent;
  color: color-mix(in srgb, var(--ink, #1a2428) 45%, transparent);
  font: 600 1rem/1 Manrope, sans-serif;
  cursor: pointer;
}

.graph-share-person-remove:hover {
  background: rgba(180, 35, 24, 0.1);
  color: #b42318;
}

.graph-share-access {
  margin: 0;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--skill-border);
  border-radius: 0.55rem;
  background: var(--surface, var(--panel-bg));
  color: var(--ink, #1a2428);
  font: 600 0.86rem/1.25 Manrope, sans-serif;
  cursor: pointer;
}

.graph-share-access:focus {
  outline: 2px solid color-mix(in srgb, var(--role) 45%, transparent);
  outline-offset: 1px;
  border-color: var(--role);
}

.graph-share-hint {
  margin: 0;
  color: color-mix(in srgb, var(--ink, #1a2428) 58%, transparent);
  font: 500 0.78rem/1.35 Manrope, sans-serif;
}

.graph-share-footer {
  display: flex;
  gap: 0.45rem;
  align-items: center;
}

.graph-share-copy {
  flex: 1;
  background: transparent;
  border: 1px solid var(--skill-border) !important;
  color: var(--role-deep);
}

.graph-share-copy:hover {
  background: color-mix(in srgb, var(--role) 12%, transparent);
}

.graph-share-done {
  background: var(--role);
  color: #fff;
}

.graph-share-done:hover {
  background: var(--role-deep);
}

.graph-share-access option[value="closed"] {
  color: #b42318;
}

.graph-zoom-step {
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 0.55rem;
  background: transparent;
  color: var(--role-deep);
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.graph-zoom-step:hover {
  background: rgba(126, 201, 188, 0.28);
  color: var(--role);
}

.graph-zoom-step:focus-visible {
  outline: 2px solid var(--kind);
  outline-offset: 1px;
}

.graph-zoom-value {
  min-width: 3rem;
  margin: 0;
  padding: 0.2rem 0.35rem;
  border: 0;
  border-radius: 0.45rem;
  background: transparent;
  color: var(--skill-ink);
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.graph-zoom-value:hover {
  background: rgba(126, 201, 188, 0.22);
}

.graph-search-input {
  width: 100%;
  margin: 0;
  padding: 0.55rem 0.7rem;
  border-radius: 0.65rem;
  border: 1px solid var(--skill-border);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 600;
  outline: none;
}

.graph-search-input:focus {
  border-color: rgba(13, 155, 138, 0.4);
}

.graph-search-input::placeholder {
  color: color-mix(in srgb, var(--skill-ink) 55%, transparent);
  font-weight: 500;
}

.graph-search-results {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 14rem;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.graph-search-empty {
  margin: 0;
  padding: 0.4rem 0.5rem;
  font-size: 0.75rem;
  color: color-mix(in srgb, var(--skill-ink) 70%, transparent);
}

.graph-search-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 0.55rem;
  padding: 0.45rem 0.55rem;
  background: transparent;
  cursor: pointer;
  font-family: var(--font);
  color: var(--skill-ink);
}

.graph-search-item:hover,
.graph-search-item.is-active {
  background: rgba(126, 201, 188, 0.28);
}

.graph-search-item-title {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
}

.graph-search-item-meta {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.68rem;
  font-weight: 500;
  color: color-mix(in srgb, var(--skill-ink) 72%, transparent);
}

/* Контекстное меню навыка */
.graph-ctx {
  position: fixed;
  z-index: 60;
  min-width: 8.5rem;
  margin: 0;
  padding: 0.3rem;
  border-radius: 0.75rem;
  border: 1px solid var(--skill-border);
  background: var(--panel-bg);
  box-shadow: 0 8px 24px rgba(15, 40, 36, 0.12);
}

.graph-ctx[hidden] {
  display: none !important;
}

.graph-ctx-item {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.5rem 0.7rem;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  text-align: left;
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--ink);
  cursor: pointer;
}

.graph-ctx-item[hidden] {
  display: none !important;
}

.graph-ctx-item:hover,
.graph-ctx-item:focus-visible {
  background: rgba(126, 201, 188, 0.28);
  outline: none;
}

.graph-ctx-item.is-danger {
  color: #b42318;
}

.graph-ctx-item.is-danger:hover,
.graph-ctx-item.is-danger:focus-visible {
  background: rgba(180, 35, 24, 0.1);
}

html[data-theme="dark"] .graph-ctx-item.is-danger {
  color: #f97066;
}

html[data-theme="dark"] .graph-ctx-item.is-danger:hover,
html[data-theme="dark"] .graph-ctx-item.is-danger:focus-visible {
  background: rgba(249, 112, 102, 0.14);
}
