/* ===== Toolbar ===== */
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-left: 1px solid var(--line);
}
.toolbar-group:first-child { border-left: none; }
.toolbar-group--end { margin-left: auto; }

.field {
  display: flex;
  align-items: center;
  gap: 6px;
}
.field label {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

/* ===== Form controls ===== */
input, select, button {
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
}

input[type=text], select {
  height: 32px;
  border: 1px solid var(--node-border);
  border-radius: 6px;
  padding: 0 9px;
  background: var(--surface);
  min-width: 110px;
  transition: border-color .12s;
}
input[type=text]:focus, select:focus {
  outline: 2px solid var(--accent-soft);
  outline-offset: 0;
  border-color: var(--accent);
}

/* ===== Buttons ===== */
.btn {
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--node-border);
  border-radius: 6px;
  background: var(--surface);
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s, border-color .12s;
}
.btn:hover { background: #F2F3F5; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #2C4878; }

.btn-ghost { border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: #F2F3F5; color: var(--ink); }

.btn-danger { color: var(--danger); border-color: var(--node-border); }
.btn-danger:hover { background: #F7EFED; border-color: var(--danger); }

.btn--active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.btn--active:hover { background: #D8E5F5; }

.btn-icon {
  height: 24px;
  width: 24px;
  padding: 0;
  font-size: 16px;
  line-height: 1;
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  color: var(--muted);
}
.btn-icon:hover { color: var(--danger); background: #F7EFED; }

/* ===== Legend overlay ===== */
.legend {
  position: absolute;
  left: 14px;
  bottom: 14px;
  font-size: 11px;
  color: var(--muted);
  background: rgba(251, 251, 250, .92);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 10px;
  line-height: 1.6;
  pointer-events: none;
}
.legend b { color: var(--ink); font-weight: 500; }

.legend-privacy {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
  font-size: 10px;
  color: var(--muted);
  line-height: 1.5;
}

/* ===== Hint overlay ===== */
.hint {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  max-width: 360px;
  pointer-events: none;
  line-height: 1.7;
}
